@Test @Override public void testToString() { super.testToString(); MutableMultimap<String, Integer> multimap = this.newMultimapWithKeysValues("One", 1, "One", 2); String toString = multimap.toString(); Assert.assertTrue("{One=[1, 2]}".equals(toString) || "{One=[2, 1]}".equals(toString)); }
@Benchmark public void parallel_eager_forkjoin_ec() { MutableMultimap<Alphagram, String> groupBy = FJIterate.groupBy(this.ecWords, Alphagram::new); CompositeFastList<RichIterable<String>> select = FJIterate.select( groupBy.multiValuesView(), iterable -> iterable.size() >= SIZE_THRESHOLD, new CompositeFastList<>(), false); Collection<String> collect = FJIterate.collect( select .toSortedList(Comparators.<RichIterable<String>>byIntFunction(RichIterable::size)) .asReversed(), iterable -> iterable.size() + ": " + iterable); FJIterate.forEach(collect, Procedures.cast(e -> Assert.assertFalse(e.isEmpty()))); }