@Test public void testToImmutableMap_valuesCollected() {

  ImmutableList<Town> towns =
      ImmutableList.of(new Town("WA", 100), new Town("WA", 50), new Town("IL", 200));
  assertThat(
          BiStream.from(towns, Town::getState, town -> town)
              .collect(toImmutableMap(summingInt(Town::getPopulation))))
      .containsExactly("WA", 150, "IL", 200)
      .inOrder();
}