@Test public void testGroupingBy() {

  Map<Integer, List<Integer>> groups =
      Stream.of(0, 1, 2).collect(BiStream.groupingBy(n -> n / 2)).toMap();
  assertThat(groups).containsExactly(0, ImmutableList.of(0, 1), 1, ImmutableList.of(2)).inOrder();
}