/** * The supplied multimap will be mutated and an unmodifiable instance used in its stead. The * multimap must support null keys and values. */ private static void checkUnmodifiableMultimap( Multimap<String, Integer> multimap, boolean permitsDuplicates) { checkUnmodifiableMultimap(multimap, permitsDuplicates, null, null); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableArrayListMultimap() { checkUnmodifiableMultimap(ArrayListMultimap.<String, Integer>create(), true); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableHashMultimap() { checkUnmodifiableMultimap(HashMultimap.<String, Integer>create(), false); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedArrayListMultimap() { checkUnmodifiableMultimap( Multimaps.synchronizedListMultimap(ArrayListMultimap.<String, Integer>create()), true); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedHashMultimap() { checkUnmodifiableMultimap( Multimaps.synchronizedSetMultimap(HashMultimap.<String, Integer>create()), false); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableTreeMultimap() { checkUnmodifiableMultimap(TreeMultimap.<String, Integer>create(), false, "null", 42); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedTreeMultimap() { TreeMultimap<String, Integer> delegate = TreeMultimap.create(Ordering.<String>natural(), INT_COMPARATOR); SortedSetMultimap<String, Integer> multimap = Multimaps.synchronizedSortedSetMultimap(delegate); checkUnmodifiableMultimap(multimap, false, "null", 42); assertSame(INT_COMPARATOR, multimap.valueComparator()); }
/** * The supplied multimap will be mutated and an unmodifiable instance used * in its stead. The multimap must support null keys and values. */ private static void checkUnmodifiableMultimap( Multimap<String, Integer> multimap, boolean permitsDuplicates) { checkUnmodifiableMultimap(multimap, permitsDuplicates, null, null); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableArrayListMultimap() { checkUnmodifiableMultimap( ArrayListMultimap.<String, Integer>create(), true); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableHashMultimap() { checkUnmodifiableMultimap(HashMultimap.<String, Integer>create(), false); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedArrayListMultimap() { checkUnmodifiableMultimap(Multimaps.synchronizedListMultimap( ArrayListMultimap.<String, Integer>create()), true); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedHashMultimap() { checkUnmodifiableMultimap(Multimaps.synchronizedSetMultimap( HashMultimap.<String, Integer>create()), false); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableTreeMultimap() { checkUnmodifiableMultimap( TreeMultimap.<String, Integer>create(), false, "null", 42); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedTreeMultimap() { TreeMultimap<String, Integer> delegate = TreeMultimap.create(Ordering.<String>natural(), INT_COMPARATOR); SortedSetMultimap<String, Integer> multimap = Multimaps.synchronizedSortedSetMultimap(delegate); checkUnmodifiableMultimap(multimap, false, "null", 42); assertSame(INT_COMPARATOR, multimap.valueComparator()); }