| 890 | } |
| 891 | |
| 892 | public void testToMap() { |
| 893 | Iterable<String> strings = ImmutableList.of("one", "two", "three"); |
| 894 | ImmutableMap<String, Integer> map = Maps.toMap(strings, LENGTH_FUNCTION); |
| 895 | assertEquals(ImmutableMap.of("one", 3, "two", 3, "three", 5), map); |
| 896 | assertThat(map.entrySet()) |
| 897 | .containsExactly(mapEntry("one", 3), mapEntry("two", 3), mapEntry("three", 5)) |
| 898 | .inOrder(); |
| 899 | } |
| 900 | |
| 901 | public void testToMapIterator() { |
| 902 | Iterator<String> strings = ImmutableList.of("one", "two", "three").iterator(); |