@Test public void testToImmutableMap_keyEncounterOrderRetainedThroughValueCollector() {

  ImmutableList<Town> towns =
      ImmutableList.of(
          new Town("WA", 1),
          new Town("FL", 2),
          new Town("WA", 3),
          new Town("IL", 4),
          new Town("AZ", 5),
          new Town("OH", 6),
          new Town("IN", 7),
          new Town("CA", 8),
          new Town("CA", 9));
  assertThat(
          BiStream.from(towns, Town::getState, town -> town)
              .collect(toImmutableMap(summingInt(Town::getPopulation))))
      .containsExactly("WA", 4, "FL", 2, "IL", 4, "AZ", 5, "OH", 6, "IN", 7, "CA", 17)
      .inOrder();
}