MCPcopy
hub / github.com/google/guava / testToMap

Method testToMap

guava-tests/test/com/google/common/collect/MapsTest.java:892–899  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 7

ofMethod · 0.95
toMapMethod · 0.95
ofMethod · 0.95
inOrderMethod · 0.65
entrySetMethod · 0.65
assertEqualsMethod · 0.45
mapEntryMethod · 0.45

Tested by

no test coverage detected