@Test public void shouldSplitIntoSingleBucketWhenAllItemsMeetsCriteria() { this.is = Arrays.asList(1, 2, 3); final Map<Integer, Collection<Integer>> actual = FCollection.bucket( this.is, fortyTwo()); final Map<Integer, Collection<Integer>> expected = new HashMap<>(); expected.put(42, Arrays.asList(1, 2, 3)); assertEquals(expected, actual); }
@Test public void flatMapShouldTreatNullAsEmptyIterable() { assertEquals(Collections.emptyList(), FCollection.flatMap(null, objectToObjectIterable())); }