diff --git a/integration-tests/guava-v31.1-expected-changes.patch b/integration-tests/guava-v31.1-expected-changes.patch index e69de29b..1ccadd0c 100644 --- a/integration-tests/guava-v31.1-expected-changes.patch +++ b/integration-tests/guava-v31.1-expected-changes.patch @@ -0,0 +1,17510 @@ +diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTestSuiteBuilder.java +index 02efe30663..081ddc220a 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTestSuiteBuilder.java +@@ -51,8 +51,8 @@ public abstract class AbstractCollectionTestSuiteBuilder< + B extends AbstractCollectionTestSuiteBuilder, E> + extends PerCollectionSizeTestSuiteBuilder, Collection, E> { + // Class parameters must be raw. +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + protected List> getTesters() { + return Arrays.>asList( + CollectionAddAllTester.class, +diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractContainerTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractContainerTester.java +index b86ef1750d..6e228b3886 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/AbstractContainerTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/AbstractContainerTester.java +@@ -16,12 +16,13 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.unmodifiableList; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import org.junit.Ignore; + +@@ -215,7 +216,7 @@ public abstract class AbstractContainerTester + for (E e : getSubjectGenerator().order(new ArrayList(getSampleElements()))) { + list.add(e); + } +- return Collections.unmodifiableList(list); ++ return unmodifiableList(list); + } + + /** +diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java +index f1b8f86d1b..70f30f0c88 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/AbstractIteratorTester.java +@@ -16,6 +16,7 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.frequency; + import static junit.framework.Assert.assertEquals; + import static junit.framework.Assert.fail; + +@@ -23,7 +24,6 @@ import com.google.common.annotations.GwtCompatible; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; + import java.util.ListIterator; +@@ -352,7 +352,7 @@ abstract class AbstractIteratorTester> { + } + + private void compareResultsForThisListOfStimuli() { +- int removes = Collections.frequency(Arrays.asList(stimuli), remove); ++ int removes = frequency(Arrays.asList(stimuli), remove); + if ((!features.contains(IteratorFeature.SUPPORTS_REMOVE) && removes > 1) + || (stimuli.length >= 5 && removes > 2)) { + // removes are the most expensive thing to test, since they often throw exceptions with stack +diff --git a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java +index 590c23be8c..51caab51b7 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/AbstractMapTester.java +@@ -145,8 +145,8 @@ public abstract class AbstractMapTester + } + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + protected MinimalCollection> createDisjointCollection() { + return MinimalCollection.of(e3(), e4()); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java b/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java +index a04d3ffe30..31e4ec7737 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java +@@ -239,8 +239,7 @@ public final class DerivedCollectionGenerators { + @Override + public V[] createArray(int length) { + // noinspection UnnecessaryLocalVariable +- V[] vs = ((TestMapGenerator) mapGenerator.getInnerGenerator()).createValueArray(length); +- return vs; ++ return ((TestMapGenerator) mapGenerator.getInnerGenerator()).createValueArray(length); + } + + @Override +diff --git a/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java +index db086aa307..5bc978a327 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/FeatureSpecificTestSuiteBuilder.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing; + + import static java.util.Collections.disjoint; ++import static java.util.Collections.unmodifiableSet; + import static java.util.logging.Level.FINER; + + import com.google.common.annotations.GwtIncompatible; +@@ -28,7 +29,6 @@ import java.lang.reflect.Method; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Enumeration; + import java.util.HashSet; + import java.util.LinkedHashSet; +@@ -114,7 +114,7 @@ public abstract class FeatureSpecificTestSuiteBuilder< + } + + public Set> getFeatures() { +- return Collections.unmodifiableSet(features); ++ return unmodifiableSet(features); + } + + // Name +diff --git a/guava-testlib/src/com/google/common/collect/testing/Helpers.java b/guava-testlib/src/com/google/common/collect/testing/Helpers.java +index aac71cc4ef..a739f6e930 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/Helpers.java ++++ b/guava-testlib/src/com/google/common/collect/testing/Helpers.java +@@ -16,6 +16,7 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.singletonMap; + import static java.util.Collections.sort; + import static junit.framework.Assert.assertEquals; + import static junit.framework.Assert.assertFalse; +@@ -71,7 +72,7 @@ public class Helpers { + + // Would use Maps.immutableEntry + public static Entry mapEntry(K key, V value) { +- return Collections.singletonMap(key, value).entrySet().iterator().next(); ++ return singletonMap(key, value).entrySet().iterator().next(); + } + + private static boolean isEmpty(Iterable iterable) { +@@ -380,8 +381,8 @@ public class Helpers { + throw new UnsupportedOperationException(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public boolean equals(Object o) { + if (o instanceof Entry) { + Entry e = (Entry) o; +@@ -419,8 +420,8 @@ public class Helpers { + + private static final Comparator NATURAL_ORDER = + new Comparator() { +- @SuppressWarnings("unchecked") // assume any Comparable is Comparable +- @Override ++ @Override // assume any Comparable is Comparable ++ @SuppressWarnings("unchecked") + public int compare(Comparable left, Comparable right) { + return left.compareTo(right); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/IteratorFeature.java b/guava-testlib/src/com/google/common/collect/testing/IteratorFeature.java +index c447e2922e..1a5dfb5a83 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/IteratorFeature.java ++++ b/guava-testlib/src/com/google/common/collect/testing/IteratorFeature.java +@@ -16,8 +16,10 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.emptySet; ++import static java.util.Collections.unmodifiableSet; ++ + import com.google.common.annotations.GwtCompatible; +-import java.util.Collections; + import java.util.EnumSet; + import java.util.Iterator; + import java.util.ListIterator; +@@ -49,12 +51,12 @@ public enum IteratorFeature { + * A set containing none of the optional features of the {@link Iterator} or {@link ListIterator} + * interfaces. + */ +- public static final Set UNMODIFIABLE = Collections.emptySet(); ++ public static final Set UNMODIFIABLE = emptySet(); + + /** + * A set containing all of the optional features of the {@link Iterator} and {@link ListIterator} + * interfaces. + */ + public static final Set MODIFIABLE = +- Collections.unmodifiableSet(EnumSet.allOf(IteratorFeature.class)); ++ unmodifiableSet(EnumSet.allOf(IteratorFeature.class)); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java b/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java +index 4849138785..890ad9eb59 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java ++++ b/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java +@@ -16,12 +16,14 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.emptyMap; ++import static java.util.Collections.emptySet; + import static java.util.Collections.singleton; ++import static java.util.Collections.singletonMap; + + import com.google.common.annotations.GwtCompatible; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Map; +@@ -183,7 +185,7 @@ public abstract class MapInterfaceTest extends TestCase { + assertTrue(map.containsKey(key)); + assertTrue(map.containsValue(value)); + assertTrue(valueCollection.contains(value)); +- assertTrue(valueCollection.containsAll(Collections.singleton(value))); ++ assertTrue(valueCollection.containsAll(singleton(value))); + assertTrue(entrySet.contains(mapEntry(key, value))); + assertTrue(allowsNullKeys || (key != null)); + } +@@ -847,7 +849,7 @@ public abstract class MapInterfaceTest extends TestCase { + // Explicitly call `equals`; `assertEquals` might return fast + assertTrue(map.equals(map)); + assertTrue(makePopulatedMap().equals(map)); +- assertFalse(map.equals(Collections.emptyMap())); ++ assertFalse(map.equals(emptyMap())); + // no-inspection ObjectEqualsNull + assertFalse(map.equals(null)); + } +@@ -899,8 +901,8 @@ public abstract class MapInterfaceTest extends TestCase { + // Explicitly call `equals`; `assertEquals` might return fast + assertTrue(map.equals(map)); + assertTrue(makeEmptyMap().equals(map)); +- assertEquals(Collections.emptyMap(), map); +- assertFalse(map.equals(Collections.emptySet())); ++ assertEquals(emptyMap(), map); ++ assertFalse(map.equals(emptySet())); + // noinspection ObjectEqualsNull + assertFalse(map.equals(null)); + } +@@ -1130,7 +1132,7 @@ public abstract class MapInterfaceTest extends TestCase { + } catch (UnsupportedOperationException e) { + return; + } +- Map mapToPut = Collections.singletonMap(keyToPut, valueToPut); ++ Map mapToPut = singletonMap(keyToPut, valueToPut); + if (supportsPut) { + int initialSize = map.size(); + map.putAll(mapToPut); +@@ -1159,7 +1161,7 @@ public abstract class MapInterfaceTest extends TestCase { + return; + } + keyToPut = map.keySet().iterator().next(); +- Map mapToPut = Collections.singletonMap(keyToPut, valueToPut); ++ Map mapToPut = singletonMap(keyToPut, valueToPut); + int initialSize = map.size(); + if (supportsPut) { + map.putAll(mapToPut); +@@ -1267,12 +1269,12 @@ public abstract class MapInterfaceTest extends TestCase { + K key = keys.iterator().next(); + if (supportsRemove) { + int initialSize = map.size(); +- assertTrue(keys.removeAll(Collections.singleton(key))); ++ assertTrue(keys.removeAll(singleton(key))); + assertEquals(initialSize - 1, map.size()); + assertFalse(map.containsKey(key)); + } else { + try { +- keys.removeAll(Collections.singleton(key)); ++ keys.removeAll(singleton(key)); + fail("Expected UnsupportedOperationException."); + } catch (UnsupportedOperationException expected) { + } +@@ -1291,12 +1293,12 @@ public abstract class MapInterfaceTest extends TestCase { + Set keys = map.keySet(); + K key = keys.iterator().next(); + if (supportsRemove) { +- keys.retainAll(Collections.singleton(key)); ++ keys.retainAll(singleton(key)); + assertEquals(1, map.size()); + assertTrue(map.containsKey(key)); + } else { + try { +- keys.retainAll(Collections.singleton(key)); ++ keys.retainAll(singleton(key)); + fail("Expected UnsupportedOperationException."); + } catch (UnsupportedOperationException expected) { + } +@@ -1617,6 +1619,6 @@ public abstract class MapInterfaceTest extends TestCase { + } + + static Entry mapEntry(K key, V value) { +- return Collections.singletonMap(key, value).entrySet().iterator().next(); ++ return singletonMap(key, value).entrySet().iterator().next(); + } + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/MapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/MapTestSuiteBuilder.java +index d1ce3413dd..e628c81287 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/MapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/MapTestSuiteBuilder.java +@@ -73,8 +73,8 @@ public class MapTestSuiteBuilder + return new MapTestSuiteBuilder().usingGenerator(generator); + } + +- @SuppressWarnings("unchecked") // Class parameters must be raw. +- @Override ++ @Override // Class parameters must be raw. ++ @SuppressWarnings("unchecked") + protected List> getTesters() { + return Arrays.>asList( + MapClearTester.class, +diff --git a/guava-testlib/src/com/google/common/collect/testing/NavigableSetTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/NavigableSetTestSuiteBuilder.java +index 4c86ab4620..7f30d422fa 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/NavigableSetTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/NavigableSetTestSuiteBuilder.java +@@ -18,6 +18,7 @@ package com.google.common.collect.testing; + + import static com.google.common.collect.testing.features.CollectionFeature.DESCENDING_VIEW; + import static com.google.common.collect.testing.features.CollectionFeature.SUBSET_VIEW; ++import static java.util.Collections.reverse; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.DerivedCollectionGenerators.Bound; +@@ -26,7 +27,6 @@ import com.google.common.collect.testing.features.Feature; + import com.google.common.collect.testing.testers.NavigableSetNavigationTester; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import java.util.NavigableSet; + import java.util.Set; +@@ -127,7 +127,7 @@ public final class NavigableSetTestSuiteBuilder extends SortedSetTestSuiteBui + for (E e : delegate.order(insertionOrder)) { + list.add(e); + } +- Collections.reverse(list); ++ reverse(list); + return list; + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java b/guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java +index 5856e3b543..4d8ecac0e1 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java ++++ b/guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java +@@ -89,8 +89,8 @@ public final class SafeTreeMap implements Serializable, NavigableMap + delegate.clear(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Comparator comparator() { + Comparator comparator = delegate.comparator(); + if (comparator == null) { +diff --git a/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java b/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java +index 91d9fd9f75..d5e21a01cd 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java ++++ b/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java +@@ -90,8 +90,8 @@ public final class SafeTreeSet implements Serializable, NavigableSet { + delegate.clear(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Comparator comparator() { + Comparator comparator = delegate.comparator(); + if (comparator == null) { +diff --git a/guava-testlib/src/com/google/common/collect/testing/SortedMapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/SortedMapTestSuiteBuilder.java +index 7944aaa6a0..d43238afa5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/SortedMapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/SortedMapTestSuiteBuilder.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing; + + import static com.google.common.collect.testing.features.CollectionFeature.KNOWN_ORDER; ++import static java.util.Collections.emptySet; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.DerivedCollectionGenerators.Bound; +@@ -24,7 +25,6 @@ import com.google.common.collect.testing.DerivedCollectionGenerators.SortedMapSu + import com.google.common.collect.testing.features.Feature; + import com.google.common.collect.testing.testers.SortedMapNavigationTester; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Map; + import java.util.Map.Entry; +@@ -94,7 +94,7 @@ public class SortedMapTestSuiteBuilder extends MapTestSuiteBuilder { + + @Override + public Set> getImpliedFeatures() { +- return Collections.emptySet(); ++ return emptySet(); + } + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/TestsForListsInJavaUtil.java b/guava-testlib/src/com/google/common/collect/testing/TestsForListsInJavaUtil.java +index e8eae2c252..d109b0c178 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/TestsForListsInJavaUtil.java ++++ b/guava-testlib/src/com/google/common/collect/testing/TestsForListsInJavaUtil.java +@@ -23,6 +23,11 @@ import static com.google.common.collect.testing.testers.ListSubListTester.getSub + import static com.google.common.collect.testing.testers.ListSubListTester.getSubListOriginalListSetAffectsSubListMethod; + import static com.google.common.collect.testing.testers.ListSubListTester.getSubListSubListRemoveAffectsOriginalLargeListMethod; + import static java.util.Arrays.asList; ++import static java.util.Collections.checkedList; ++import static java.util.Collections.emptyList; ++import static java.util.Collections.emptySet; ++import static java.util.Collections.singletonList; ++import static java.util.Collections.unmodifiableList; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.features.CollectionFeature; +@@ -72,23 +77,23 @@ public class TestsForListsInJavaUtil { + } + + protected Collection suppressForEmptyList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForSingletonList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForArraysAsList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForArrayList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCopyOnWriteArrayList() { +@@ -102,23 +107,23 @@ public class TestsForListsInJavaUtil { + } + + protected Collection suppressForUnmodifiableList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCheckedList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForAbstractList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForAbstractSequentialList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForVector() { +- return Collections.emptySet(); ++ return emptySet(); + } + + public Test testsForEmptyList() { +@@ -126,7 +131,7 @@ public class TestsForListsInJavaUtil { + new TestStringListGenerator() { + @Override + public List create(String[] elements) { +- return Collections.emptyList(); ++ return emptyList(); + } + }) + .named("emptyList") +@@ -140,7 +145,7 @@ public class TestsForListsInJavaUtil { + new TestStringListGenerator() { + @Override + public List create(String[] elements) { +- return Collections.singletonList(elements[0]); ++ return singletonList(elements[0]); + } + }) + .named("singletonList") +@@ -237,7 +242,7 @@ public class TestsForListsInJavaUtil { + public List create(String[] elements) { + List innerList = new ArrayList<>(); + Collections.addAll(innerList, elements); +- return Collections.unmodifiableList(innerList); ++ return unmodifiableList(innerList); + } + }) + .named("unmodifiableList/ArrayList") +@@ -256,7 +261,7 @@ public class TestsForListsInJavaUtil { + public List create(String[] elements) { + List innerList = new ArrayList<>(); + Collections.addAll(innerList, elements); +- return Collections.checkedList(innerList, String.class); ++ return checkedList(innerList, String.class); + } + }) + .named("checkedList/ArrayList") +diff --git a/guava-testlib/src/com/google/common/collect/testing/TestsForMapsInJavaUtil.java b/guava-testlib/src/com/google/common/collect/testing/TestsForMapsInJavaUtil.java +index fed059c399..5dfd095eeb 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/TestsForMapsInJavaUtil.java ++++ b/guava-testlib/src/com/google/common/collect/testing/TestsForMapsInJavaUtil.java +@@ -17,6 +17,18 @@ + package com.google.common.collect.testing; + + import static java.util.Arrays.asList; ++import static java.util.Collections.checkedMap; ++import static java.util.Collections.checkedNavigableMap; ++import static java.util.Collections.checkedSortedMap; ++import static java.util.Collections.emptyMap; ++import static java.util.Collections.emptyNavigableMap; ++import static java.util.Collections.emptySet; ++import static java.util.Collections.emptySortedMap; ++import static java.util.Collections.singletonMap; ++import static java.util.Collections.synchronizedNavigableMap; ++import static java.util.Collections.unmodifiableMap; ++import static java.util.Collections.unmodifiableNavigableMap; ++import static java.util.Collections.unmodifiableSortedMap; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.features.CollectionFeature; +@@ -26,7 +38,6 @@ import com.google.common.collect.testing.testers.MapEntrySetTester; + import java.io.Serializable; + import java.lang.reflect.Method; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.EnumMap; + import java.util.HashMap; +@@ -81,75 +92,75 @@ public class TestsForMapsInJavaUtil { + } + + protected Collection suppressForCheckedMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCheckedNavigableMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCheckedSortedMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEmptyMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + private Collection suppressForEmptyNavigableMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + private Collection suppressForEmptySortedMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForSingletonMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForHashMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForHashtable() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedHashMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForSynchronizedNavigableMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForTreeMapNatural() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForTreeMapWithComparator() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForUnmodifiableMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForUnmodifiableNavigableMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForUnmodifiableSortedMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEnumMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentHashMap() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentSkipListMap() { +@@ -165,7 +176,7 @@ public class TestsForMapsInJavaUtil { + @Override + protected Map create(Entry[] entries) { + Map map = populate(new HashMap(), entries); +- return Collections.checkedMap(map, String.class, String.class); ++ return checkedMap(map, String.class, String.class); + } + }) + .named("checkedMap/HashMap") +@@ -190,7 +201,7 @@ public class TestsForMapsInJavaUtil { + @Override + protected NavigableMap create(Entry[] entries) { + NavigableMap map = populate(new TreeMap(), entries); +- return Collections.checkedNavigableMap(map, String.class, String.class); ++ return checkedNavigableMap(map, String.class, String.class); + } + }) + .named("checkedNavigableMap/TreeMap, natural") +@@ -214,7 +225,7 @@ public class TestsForMapsInJavaUtil { + @Override + protected SortedMap create(Entry[] entries) { + SortedMap map = populate(new TreeMap(), entries); +- return Collections.checkedSortedMap(map, String.class, String.class); ++ return checkedSortedMap(map, String.class, String.class); + } + }) + .named("checkedSortedMap/TreeMap, natural") +@@ -237,7 +248,7 @@ public class TestsForMapsInJavaUtil { + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { +- return Collections.emptyMap(); ++ return emptyMap(); + } + }) + .named("emptyMap") +@@ -251,7 +262,7 @@ public class TestsForMapsInJavaUtil { + new TestStringSortedMapGenerator() { + @Override + protected NavigableMap create(Entry[] entries) { +- return Collections.emptyNavigableMap(); ++ return emptyNavigableMap(); + } + }) + .named("emptyNavigableMap") +@@ -265,7 +276,7 @@ public class TestsForMapsInJavaUtil { + new TestStringSortedMapGenerator() { + @Override + protected SortedMap create(Entry[] entries) { +- return Collections.emptySortedMap(); ++ return emptySortedMap(); + } + }) + .named("emptySortedMap") +@@ -279,7 +290,7 @@ public class TestsForMapsInJavaUtil { + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { +- return Collections.singletonMap(entries[0].getKey(), entries[0].getValue()); ++ return singletonMap(entries[0].getKey(), entries[0].getValue()); + } + }) + .named("singletonMap") +@@ -371,7 +382,7 @@ public class TestsForMapsInJavaUtil { + @Override + protected SortedMap create(Entry[] entries) { + NavigableMap delegate = populate(new TreeMap<>(), entries); +- return Collections.synchronizedNavigableMap(delegate); ++ return synchronizedNavigableMap(delegate); + } + }) + .named("synchronizedNavigableMap/TreeMap, natural") +@@ -441,7 +452,7 @@ public class TestsForMapsInJavaUtil { + new TestStringMapGenerator() { + @Override + protected Map create(Entry[] entries) { +- return Collections.unmodifiableMap(toHashMap(entries)); ++ return unmodifiableMap(toHashMap(entries)); + } + }) + .named("unmodifiableMap/HashMap") +@@ -460,7 +471,7 @@ public class TestsForMapsInJavaUtil { + new TestStringSortedMapGenerator() { + @Override + protected NavigableMap create(Entry[] entries) { +- return Collections.unmodifiableNavigableMap(populate(new TreeMap<>(), entries)); ++ return unmodifiableNavigableMap(populate(new TreeMap<>(), entries)); + } + }) + .named("unmodifiableNavigableMap/TreeMap, natural") +@@ -479,7 +490,7 @@ public class TestsForMapsInJavaUtil { + @Override + protected SortedMap create(Entry[] entries) { + SortedMap map = populate(new TreeMap(), entries); +- return Collections.unmodifiableSortedMap(map); ++ return unmodifiableSortedMap(map); + } + }) + .named("unmodifiableSortedMap/TreeMap, natural") +diff --git a/guava-testlib/src/com/google/common/collect/testing/TestsForQueuesInJavaUtil.java b/guava-testlib/src/com/google/common/collect/testing/TestsForQueuesInJavaUtil.java +index 1a9870daf6..c15d6603af 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/TestsForQueuesInJavaUtil.java ++++ b/guava-testlib/src/com/google/common/collect/testing/TestsForQueuesInJavaUtil.java +@@ -16,13 +16,15 @@ + + package com.google.common.collect.testing; + ++import static java.util.Collections.checkedQueue; ++import static java.util.Collections.emptySet; ++ + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; + import java.lang.reflect.Method; + import java.util.ArrayDeque; + import java.util.Collection; +-import java.util.Collections; + import java.util.LinkedList; + import java.util.PriorityQueue; + import java.util.Queue; +@@ -63,43 +65,43 @@ public class TestsForQueuesInJavaUtil { + } + + protected Collection suppressForCheckedQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForArrayDeque() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedList() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForArrayBlockingQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentLinkedDeque() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentLinkedQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedBlockingDeque() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedBlockingQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForPriorityBlockingQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForPriorityQueue() { +- return Collections.emptySet(); ++ return emptySet(); + } + + public Test testsForCheckedQueue() { +@@ -108,7 +110,7 @@ public class TestsForQueuesInJavaUtil { + @Override + public Queue create(String[] elements) { + Queue queue = new LinkedList<>(MinimalCollection.of(elements)); +- return Collections.checkedQueue(queue, String.class); ++ return checkedQueue(queue, String.class); + } + }) + .named("checkedQueue/LinkedList") +diff --git a/guava-testlib/src/com/google/common/collect/testing/TestsForSetsInJavaUtil.java b/guava-testlib/src/com/google/common/collect/testing/TestsForSetsInJavaUtil.java +index 0141d8daf4..fcf5e98379 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/TestsForSetsInJavaUtil.java ++++ b/guava-testlib/src/com/google/common/collect/testing/TestsForSetsInJavaUtil.java +@@ -19,6 +19,16 @@ package com.google.common.collect.testing; + import static com.google.common.collect.testing.testers.CollectionSpliteratorTester.getSpliteratorNotImmutableCollectionAllowsAddMethod; + import static com.google.common.collect.testing.testers.CollectionSpliteratorTester.getSpliteratorNotImmutableCollectionAllowsRemoveMethod; + import static java.util.Arrays.asList; ++import static java.util.Collections.checkedNavigableSet; ++import static java.util.Collections.checkedSet; ++import static java.util.Collections.checkedSortedSet; ++import static java.util.Collections.emptyNavigableSet; ++import static java.util.Collections.emptySet; ++import static java.util.Collections.emptySortedSet; ++import static java.util.Collections.singleton; ++import static java.util.Collections.synchronizedNavigableSet; ++import static java.util.Collections.unmodifiableNavigableSet; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.features.CollectionFeature; +@@ -82,47 +92,47 @@ public class TestsForSetsInJavaUtil { + } + + protected Collection suppressForCheckedNavigableSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEmptySet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEmptyNavigableSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEmptySortedSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForSingletonSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForHashSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForLinkedHashSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForEnumSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForSynchronizedNavigableSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForTreeSetNatural() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForTreeSetWithComparator() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCopyOnWriteArraySet() { +@@ -132,31 +142,31 @@ public class TestsForSetsInJavaUtil { + } + + protected Collection suppressForUnmodifiableSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForUnmodifiableNavigableSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCheckedSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForCheckedSortedSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForAbstractSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentSkipListSetNatural() { +- return Collections.emptySet(); ++ return emptySet(); + } + + protected Collection suppressForConcurrentSkipListSetWithComparator() { +- return Collections.emptySet(); ++ return emptySet(); + } + + public Test testsForCheckedNavigableSet() { +@@ -166,7 +176,7 @@ public class TestsForSetsInJavaUtil { + public NavigableSet create(String[] elements) { + NavigableSet innerSet = new TreeSet<>(); + Collections.addAll(innerSet, elements); +- return Collections.checkedNavigableSet(innerSet, String.class); ++ return checkedNavigableSet(innerSet, String.class); + } + }) + .named("checkedNavigableSet/TreeSet, natural") +@@ -186,7 +196,7 @@ public class TestsForSetsInJavaUtil { + new TestStringSetGenerator() { + @Override + public Set create(String[] elements) { +- return Collections.emptySet(); ++ return emptySet(); + } + }) + .named("emptySet") +@@ -200,7 +210,7 @@ public class TestsForSetsInJavaUtil { + new TestStringSortedSetGenerator() { + @Override + public NavigableSet create(String[] elements) { +- return Collections.emptyNavigableSet(); ++ return emptyNavigableSet(); + } + }) + .named("emptyNavigableSet") +@@ -214,7 +224,7 @@ public class TestsForSetsInJavaUtil { + new TestStringSortedSetGenerator() { + @Override + public SortedSet create(String[] elements) { +- return Collections.emptySortedSet(); ++ return emptySortedSet(); + } + }) + .named("emptySortedSet") +@@ -228,7 +238,7 @@ public class TestsForSetsInJavaUtil { + new TestStringSetGenerator() { + @Override + public Set create(String[] elements) { +- return Collections.singleton(elements[0]); ++ return singleton(elements[0]); + } + }) + .named("singleton") +@@ -310,7 +320,7 @@ public class TestsForSetsInJavaUtil { + @Override + public SortedSet create(String[] elements) { + NavigableSet delegate = new TreeSet<>(MinimalCollection.of(elements)); +- return Collections.synchronizedNavigableSet(delegate); ++ return synchronizedNavigableSet(delegate); + } + }) + .named("synchronizedNavigableSet/TreeSet, natural") +@@ -392,7 +402,7 @@ public class TestsForSetsInJavaUtil { + public Set create(String[] elements) { + Set innerSet = new HashSet<>(); + Collections.addAll(innerSet, elements); +- return Collections.unmodifiableSet(innerSet); ++ return unmodifiableSet(innerSet); + } + }) + .named("unmodifiableSet/HashSet") +@@ -412,7 +422,7 @@ public class TestsForSetsInJavaUtil { + public NavigableSet create(String[] elements) { + NavigableSet innerSet = new TreeSet<>(); + Collections.addAll(innerSet, elements); +- return Collections.unmodifiableNavigableSet(innerSet); ++ return unmodifiableNavigableSet(innerSet); + } + }) + .named("unmodifiableNavigableSet/TreeSet, natural") +@@ -432,7 +442,7 @@ public class TestsForSetsInJavaUtil { + public Set create(String[] elements) { + Set innerSet = new HashSet<>(); + Collections.addAll(innerSet, elements); +- return Collections.checkedSet(innerSet, String.class); ++ return checkedSet(innerSet, String.class); + } + }) + .named("checkedSet/HashSet") +@@ -453,7 +463,7 @@ public class TestsForSetsInJavaUtil { + public SortedSet create(String[] elements) { + SortedSet innerSet = new TreeSet<>(); + Collections.addAll(innerSet, elements); +- return Collections.checkedSortedSet(innerSet, String.class); ++ return checkedSortedSet(innerSet, String.class); + } + }) + .named("checkedSortedSet/TreeSet, natural") +diff --git a/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java b/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java +index 6203e51486..04fccf9430 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java ++++ b/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java +@@ -16,13 +16,14 @@ + + package com.google.common.collect.testing.features; + ++import static java.util.Collections.emptySet; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.testing.Helpers; + import java.lang.annotation.Inherited; + import java.lang.annotation.Retention; + import java.lang.annotation.RetentionPolicy; + import java.util.Collection; +-import java.util.Collections; + import java.util.Set; + + /** +@@ -62,7 +63,7 @@ public enum CollectionSize implements Feature, Comparable>copyToSet(presentFeatures)); + Set> allAbsentFeatures = + addImpliedFeatures(Helpers.>copyToSet(absentFeatures)); +- if (!Collections.disjoint(allPresentFeatures, allAbsentFeatures)) { ++ if (!disjoint(allPresentFeatures, allAbsentFeatures)) { + throw new ConflictingRequirementsException( + "Annotation explicitly or " + + "implicitly requires one or more features to be both present " +@@ -237,7 +239,7 @@ public class FeatureUtil { + annotations.add(a); + } + } +- annotations = Collections.unmodifiableList(annotations); ++ annotations = unmodifiableList(annotations); + annotationCache.put(classOrMethod, annotations); + } + return annotations; +@@ -276,7 +278,7 @@ public class FeatureUtil { + Set> newFeatures, + Object source) + throws ConflictingRequirementsException { +- if (!Collections.disjoint(newFeatures, earlierFeatures)) { ++ if (!disjoint(newFeatures, earlierFeatures)) { + throw new ConflictingRequirementsException( + String.format( + Locale.ROOT, +diff --git a/guava-testlib/src/com/google/common/collect/testing/features/TesterAnnotation.java b/guava-testlib/src/com/google/common/collect/testing/features/TesterAnnotation.java +index 1831e417f0..02c900c07c 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/features/TesterAnnotation.java ++++ b/guava-testlib/src/com/google/common/collect/testing/features/TesterAnnotation.java +@@ -29,8 +29,8 @@ import java.lang.annotation.Target; + * + * @author George van den Driessche + */ +-@Target(value = {java.lang.annotation.ElementType.ANNOTATION_TYPE}) +-@Retention(value = RetentionPolicy.RUNTIME) ++@Target(java.lang.annotation.ElementType.ANNOTATION_TYPE) ++@Retention(RetentionPolicy.RUNTIME) + @Documented + @GwtCompatible + public @interface TesterAnnotation {} +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java b/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java +index a72fd9fba5..bdcffa19f2 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java +@@ -137,20 +137,20 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToOne_addSupported() { + assertOneToOne(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToOne_removeSupported() { + assertOneToOne(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToOne_unsupported() { + try { + assertOneToOne(); +@@ -158,20 +158,20 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToThree_addSupported() { + assertThreeToThree(); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToThree_removeSupported() { + assertThreeToThree(); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(absent = {SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToThree_unsupported() { + try { + assertThreeToThree(); +@@ -186,7 +186,7 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + assertSetCount(e3(), 1); + } + +- @CollectionFeature.Require({SUPPORTS_ADD, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_ADD}) + public void testSetCountZeroToOneConcurrentWithIteration() { + try { + Iterator iterator = collection.iterator(); +@@ -198,7 +198,7 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionFeature.Require({SUPPORTS_ADD, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_ADD}) + public void testSetCountZeroToOneConcurrentWithEntrySetIteration() { + try { + Iterator> iterator = getMultiset().entrySet().iterator(); +@@ -215,8 +215,8 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + assertSetCount(e3(), 3); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToThree_supported() { + assertSetCount(e0(), 3); + } +@@ -231,21 +231,21 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + assertSetCountIncreasingFailure(e3(), 3); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = SUPPORTS_ADD) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToThree_unsupported() { + assertSetCountIncreasingFailure(e3(), 3); + } + + // Unconditional setCount size decreases: + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToZero_supported() { + assertSetCount(e0(), 0); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) + public void testSetCountOneToZeroConcurrentWithIteration() { + try { +@@ -258,7 +258,7 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) + public void testSetCountOneToZeroConcurrentWithEntrySetIteration() { + try { +@@ -271,35 +271,35 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToZero_supported() { + initThreeCopies(); + assertSetCount(e0(), 0); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToOne_supported() { + initThreeCopies(); + assertSetCount(e0(), 1); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_oneToZero_unsupported() { + assertSetCountDecreasingFailure(e0(), 0); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToZero_unsupported() { + initThreeCopies(); + assertSetCountDecreasingFailure(e0(), 0); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testSetCount_threeToOne_unsupported() { + initThreeCopies(); + assertSetCountDecreasingFailure(e0(), 1); +@@ -307,15 +307,15 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + + // setCount with nulls: + ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) + public void testSetCount_removeNull_nullSupported() { + initCollectionWithNullElement(); + assertSetCount(null, 0); + } + + @CollectionFeature.Require( +- value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES}, ++ value = {ALLOWS_NULL_VALUES, SUPPORTS_ADD}, + absent = RESTRICTS_ELEMENTS) + public void testSetCount_addNull_nullSupported() { + assertSetCount(null, 1); +@@ -346,8 +346,8 @@ public abstract class AbstractMultisetSetCountTester extends AbstractMultiset + } + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCount_existingNoNopNull_nullSupported() { + initCollectionWithNullElement(); + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapEntrySetTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapEntrySetTester.java +index 5c9a47989b..f23146406b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapEntrySetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapEntrySetTester.java +@@ -31,8 +31,8 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class BiMapEntrySetTester extends AbstractBiMapTester { +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testSetValue_valueAbsent() { + for (Entry entry : getMap().entrySet()) { + if (entry.getKey().equals(k0())) { +@@ -42,8 +42,8 @@ public class BiMapEntrySetTester extends AbstractBiMapTester { + expectReplacement(entry(k0(), v3())); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testSetValue_valuePresent() { + for (Entry entry : getMap().entrySet()) { + if (entry.getKey().equals(k0())) { +@@ -57,8 +57,8 @@ public class BiMapEntrySetTester extends AbstractBiMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testSetValueNullUnsupported() { + for (Entry entry : getMap().entrySet()) { + try { +@@ -70,8 +70,8 @@ public class BiMapEntrySetTester extends AbstractBiMapTester { + } + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testSetValueNullSupported() { + for (Entry entry : getMap().entrySet()) { + if (entry.getKey().equals(k0())) { +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java +index 984558e2b7..460df42e9b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapInverseTester.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing.google; + + import static com.google.common.collect.testing.features.CollectionFeature.SERIALIZABLE; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -26,7 +27,6 @@ import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.testing.SerializableTester; + import java.io.Serializable; + import java.lang.reflect.Method; +-import java.util.Collections; + import java.util.List; + import org.junit.Ignore; + +@@ -74,7 +74,7 @@ public class BiMapInverseTester extends AbstractBiMapTester { + */ + @GwtIncompatible // reflection + public static List getInverseSameAfterSerializingMethods() { +- return Collections.singletonList(getMethod("testInverseSerialization")); ++ return singletonList(getMethod("testInverseSerialization")); + } + + @GwtIncompatible // reflection +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java +index 4bb72a2f38..23728e4aa9 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapPutTester.java +@@ -34,9 +34,9 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class BiMapPutTester extends AbstractBiMapTester { + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testPutWithSameValueFails() { + getMap().put(k0(), v0()); + try { +@@ -49,9 +49,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + expectAdded(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testPutPresentKeyDifferentValue() { + getMap().put(k0(), v0()); + getMap().put(k0(), v1()); +@@ -60,18 +60,18 @@ public class BiMapPutTester extends AbstractBiMapTester { + expectContents(Helpers.mapEntry(k0(), v1())); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void putDistinctKeysDistinctValues() { + getMap().put(k0(), v0()); + getMap().put(k1(), v1()); + expectAdded(e0(), e1()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ONE) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testForcePutKeyPresent() { + getMap().forcePut(k0(), v1()); + expectContents(Helpers.mapEntry(k0(), v1())); +@@ -81,9 +81,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + assertTrue(getMap().containsKey(k0())); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ONE) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testForcePutValuePresent() { + getMap().forcePut(k1(), v0()); + expectContents(Helpers.mapEntry(k1(), v0())); +@@ -92,9 +92,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + assertFalse(getMap().containsKey(k0())); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testForcePutKeyAndValuePresent() { + getMap().forcePut(k0(), v1()); + expectContents(Helpers.mapEntry(k0(), v1()), Helpers.mapEntry(k2(), v2())); +@@ -103,9 +103,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + assertFalse(getMap().containsValue(v0())); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) + @CollectionSize.Require(ONE) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) ++ @SuppressWarnings("unchecked") + public void testForcePutNullKeyPresent() { + initMapWithNullKey(); + +@@ -122,9 +122,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + assertEquals(1, getMap().size()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(ONE) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) ++ @SuppressWarnings("unchecked") + public void testForcePutNullValuePresent() { + initMapWithNullValue(); + +@@ -143,9 +143,9 @@ public class BiMapPutTester extends AbstractBiMapTester { + + // nb: inverse is run through its own entire suite + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) ++ @SuppressWarnings("unchecked") + public void testInversePut() { + getMap().put(k0(), v0()); + getMap().inverse().put(v1(), k1()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java +index e54256ad86..65cb0f1cf2 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapRemoveTester.java +@@ -35,49 +35,49 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class BiMapRemoveTester extends AbstractBiMapTester { +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveKeyRemovesFromInverse() { + getMap().remove(k0()); + expectMissing(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveKeyFromKeySetRemovesFromInverse() { + getMap().keySet().remove(k0()); + expectMissing(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveFromValuesRemovesFromInverse() { + getMap().values().remove(v0()); + expectMissing(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveFromInverseRemovesFromForward() { + getMap().inverse().remove(v0()); + expectMissing(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveFromInverseKeySetRemovesFromForward() { + getMap().inverse().keySet().remove(v0()); + expectMissing(e0()); + } + +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testRemoveFromInverseValuesRemovesFromInverse() { + getMap().inverse().values().remove(k0()); + expectMissing(e0()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/BiMapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/BiMapTestSuiteBuilder.java +index 0821fb0b55..d3c40afc6d 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/BiMapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/BiMapTestSuiteBuilder.java +@@ -16,6 +16,8 @@ + + package com.google.common.collect.testing.google; + ++import static java.util.Collections.emptySet; ++ + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.BiMap; + import com.google.common.collect.testing.AbstractTester; +@@ -32,7 +34,6 @@ import com.google.common.collect.testing.google.DerivedGoogleCollectionGenerator + import com.google.common.collect.testing.google.DerivedGoogleCollectionGenerators.MapGenerator; + import com.google.common.collect.testing.testers.SetCreationTester; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.HashSet; + import java.util.List; + import java.util.Map.Entry; +@@ -69,7 +70,7 @@ public class BiMapTestSuiteBuilder + + @Override + public Set> getImpliedFeatures() { +- return Collections.emptySet(); ++ return emptySet(); + } + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/DerivedGoogleCollectionGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/DerivedGoogleCollectionGenerators.java +index 35579a01d7..0545fab220 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/DerivedGoogleCollectionGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/DerivedGoogleCollectionGenerators.java +@@ -69,14 +69,14 @@ public final class DerivedGoogleCollectionGenerators { + return generator.order(insertionOrder); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public K[] createKeyArray(int length) { + return (K[]) new Object[length]; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public V[] createValueArray(int length) { + return (V[]) new Object[length]; + } +@@ -112,8 +112,8 @@ public final class DerivedGoogleCollectionGenerators { + return Helpers.mapEntry(entry.getValue(), entry.getKey()); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public BiMap create(Object... elements) { + Entry[] entries = new Entry[elements.length]; + for (int i = 0; i < elements.length; i++) { +@@ -122,8 +122,8 @@ public final class DerivedGoogleCollectionGenerators { + return generator.create((Object[]) entries).inverse(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Entry[] createArray(int length) { + return new Entry[length]; + } +@@ -133,14 +133,14 @@ public final class DerivedGoogleCollectionGenerators { + return insertionOrder; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public V[] createKeyArray(int length) { + return (V[]) new Object[length]; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public K[] createValueArray(int length) { + return (K[]) new Object[length]; + } +@@ -194,9 +194,7 @@ public final class DerivedGoogleCollectionGenerators { + + @Override + public V[] createArray(int length) { +- V[] vs = +- ((TestBiMapGenerator) mapGenerator.getInnerGenerator()).createValueArray(length); +- return vs; ++ return ((TestBiMapGenerator) mapGenerator.getInnerGenerator()).createValueArray(length); + } + + @Override +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/ListGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/ListGenerators.java +index 0839f09188..5a03acd60c 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/ListGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/ListGenerators.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing.google; + + import static java.util.Arrays.asList; ++import static java.util.Collections.reverse; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.ImmutableList; +@@ -28,7 +29,6 @@ import com.google.common.collect.testing.TestUnhashableCollectionGenerator; + import com.google.common.collect.testing.UnhashableObject; + import com.google.common.primitives.Chars; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + + /** +@@ -70,7 +70,7 @@ public final class ListGenerators { + @Override + protected List create(String[] elements) { + List list = asList(elements); +- Collections.reverse(list); ++ reverse(list); + return ImmutableList.copyOf(list).reverse(); + } + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapAsMapTester.java b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapAsMapTester.java +index ca6f21af2c..9b6fa118eb 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapAsMapTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapAsMapTester.java +@@ -16,6 +16,8 @@ package com.google.common.collect.testing.google; + + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.singletonList; ++import static java.util.Collections.singletonMap; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Lists; +@@ -27,7 +29,6 @@ import com.google.common.collect.testing.features.MapFeature; + import com.google.common.testing.EqualsTester; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import java.util.Map; + import java.util.Map.Entry; +@@ -90,9 +91,8 @@ public class ListMultimapAsMapTester extends AbstractListMultimapTester extends AbstractListMultimapTester> entries = copyToList(multimap().entries()); + +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapRemoveTester.java +index 04ac0a2bc5..154150ccfc 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapRemoveTester.java +@@ -38,9 +38,9 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListMultimapRemoveTester extends AbstractListMultimapTester { +- @SuppressWarnings("unchecked") +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(SUPPORTS_REMOVE) ++ @SuppressWarnings("unchecked") + public void testMultimapRemoveDeletesFirstOccurrence() { + resetContainer(mapEntry(k0(), v0()), mapEntry(k0(), v1()), mapEntry(k0(), v0())); + +@@ -49,9 +49,9 @@ public class ListMultimapRemoveTester extends AbstractListMultimapTester values = Arrays.asList(v0(), v1(), v0()); + +@@ -66,9 +66,9 @@ public class ListMultimapRemoveTester extends AbstractListMultimapTester values = Arrays.asList(v0(), v1(), v0()); + +@@ -84,9 +84,9 @@ public class ListMultimapRemoveTester extends AbstractListMultimapTester values = Arrays.asList(v0(), v1(), v0()); + +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapTestSuiteBuilder.java +index b55c7d648f..1c7cfb3f90 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapTestSuiteBuilder.java +@@ -16,6 +16,8 @@ + + package com.google.common.collect.testing.google; + ++import static java.util.Collections.disjoint; ++ + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.ListMultimap; + import com.google.common.collect.testing.AbstractTester; +@@ -28,7 +30,6 @@ import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; + import com.google.common.collect.testing.features.Feature; + import com.google.common.collect.testing.features.ListFeature; +-import java.util.Collections; + import java.util.EnumSet; + import java.util.List; + import java.util.Map.Entry; +@@ -83,7 +84,7 @@ public class ListMultimapTestSuiteBuilder + ?, ? extends OneSizeTestContainerGenerator, Entry>> + parentBuilder) { + Set> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures()); +- if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) { ++ if (disjoint(features, EnumSet.allOf(CollectionSize.class))) { + return new TestSuite(); + } else { + return ListTestSuiteBuilder.using( +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java +index 3f445ca116..ad4c08939e 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java +@@ -127,8 +127,8 @@ public class MapGenerators { + mapEntry("toaster", -2)); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Entry[] createArray(int length) { + return new Entry[length]; + } +@@ -217,7 +217,7 @@ public class MapGenerators { + } + + @Override +- @SuppressWarnings({"unchecked", "rawtypes"}) // needed for arrays ++ @SuppressWarnings({"rawtypes", "unchecked"}) // needed for arrays + public Entry>[] createArray(int length) { + return new Entry[length]; + } +@@ -234,7 +234,7 @@ public class MapGenerators { + } + + @Override +- @SuppressWarnings({"unchecked", "rawtypes"}) // needed for arrays ++ @SuppressWarnings({"rawtypes", "unchecked"}) // needed for arrays + public ImmutableSet[] createValueArray(int length) { + return new ImmutableSet[length]; + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapGetTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapGetTester.java +index dadb9a3245..38abbba69a 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapGetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapAsMapGetTester.java +@@ -71,7 +71,7 @@ public class MultimapAsMapGetTester extends AbstractMultimapTester result = multimap().asMap().get(k0()); + assertTrue(result.add(null)); +@@ -79,7 +79,7 @@ public class MultimapAsMapGetTester extends AbstractMultimapTester result = multimap().asMap().get(k0()); + assertFalse(result.remove(null)); +@@ -105,7 +105,7 @@ public class MultimapAsMapGetTester extends AbstractMultimapTester extends AbstractMultimapTester>> asMapEntrySet = multimap().asMap().entrySet(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapClearTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapClearTester.java +index 6ce9907c14..8fd692b610 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapClearTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapClearTester.java +@@ -98,8 +98,8 @@ public class MultimapClearTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester + assertFalse(multimap().containsValue(v3())); + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testContainsNullValueYes() { + initMultimapWithNullValue(); + assertTrue(multimap().containsValue(null)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapEntriesTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapEntriesTester.java +index 9874b884cc..ef694f2359 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapEntriesTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapEntriesTester.java +@@ -24,6 +24,7 @@ import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_ + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUE_QUERIES; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Multimap; +@@ -31,7 +32,6 @@ import com.google.common.collect.testing.Helpers; + import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; + import com.google.common.collect.testing.features.MapFeature; +-import java.util.Collections; + import java.util.Iterator; + import java.util.Map.Entry; + import org.junit.Ignore; +@@ -84,7 +84,7 @@ public class MultimapEntriesTester extends AbstractMultimapTester extends AbstractMultimapTester> iterator = multimap().entries().iterator(); + assertEquals(Helpers.mapEntry(k0(), v0()), iterator.next()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapGetTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapGetTester.java +index 6978473232..4fd6752e3d 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapGetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapGetTester.java +@@ -25,6 +25,7 @@ import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_ + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_PUT; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Multimap; +@@ -32,7 +33,6 @@ import com.google.common.collect.testing.Helpers; + import com.google.common.collect.testing.features.CollectionSize; + import com.google.common.collect.testing.features.MapFeature; + import java.util.Collection; +-import java.util.Collections; + import org.junit.Ignore; + + /** +@@ -98,14 +98,14 @@ public class MultimapGetTester extends AbstractMultimapTester result = multimap().get(k0()); +- assertTrue(result.addAll(Collections.singletonList(v3()))); ++ assertTrue(result.addAll(singletonList(v3()))); + assertTrue(multimap().containsKey(k0())); + assertEquals(getNumElements() + 1, multimap().size()); + assertTrue(multimap().containsEntry(k0(), v3())); + } + + @CollectionSize.Require(absent = ZERO) +- @MapFeature.Require({SUPPORTS_REMOVE, SUPPORTS_PUT}) ++ @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testPropagatesRemoveLastThenAddToMultimap() { + int oldSize = getNumElements(); + +@@ -127,8 +127,8 @@ public class MultimapGetTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester keyItr = multimap().keySet().iterator(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapKeysTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapKeysTester.java +index 6b2a93ca3d..00201c1beb 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapKeysTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapKeysTester.java +@@ -85,8 +85,8 @@ public class MultimapKeysTester extends AbstractMultimapTester keys = multimap().keys(); + Iterator> itr = keys.entrySet().iterator(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutAllMultimapTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutAllMultimapTester.java +index 92622933f8..418ea8cbce 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutAllMultimapTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutAllMultimapTester.java +@@ -62,14 +62,14 @@ public class MultimapPutAllMultimapTester + assertTrue(multimap().containsEntry(k3(), v3())); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPutAllWithNullValue() { + Multimap source = getSubjectGenerator().create(Helpers.mapEntry(k0(), null)); + assertTrue(multimap().putAll(source)); + assertTrue(multimap().containsEntry(k0(), null)); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testPutAllWithNullKey() { + Multimap source = getSubjectGenerator().create(Helpers.mapEntry(null, v0())); + assertTrue(multimap().putAll(source)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutIterableTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutIterableTester.java +index b36037877a..d56c9de975 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutIterableTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapPutIterableTester.java +@@ -21,6 +21,7 @@ import static com.google.common.collect.testing.features.CollectionSize.ZERO; + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS; + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_PUT; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.ImmutableSet; +@@ -87,13 +88,13 @@ public class MultimapPutIterableTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester keys = Helpers.copyToList(multimap().keySet()); + for (K key : keys) { +@@ -172,8 +172,8 @@ public class MultimapPutTester extends AbstractMultimapTester keys = Helpers.copyToList(multimap().keySet()); + for (K key : keys) { +@@ -192,8 +192,8 @@ public class MultimapPutTester extends AbstractMultimapTester keys = Helpers.copyToList(multimap().keySet()); + for (K key : keys) { +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapRemoveAllTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapRemoveAllTester.java +index 185ba2c206..c8c55569c0 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapRemoveAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapRemoveAllTester.java +@@ -76,7 +76,7 @@ public class MultimapRemoveAllTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTester extends AbstractMultimapTesterof()); + } + +- @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_KEY_QUERIES}) ++ @MapFeature.Require({ALLOWS_NULL_KEY_QUERIES, SUPPORTS_REMOVE}) + public void testRemoveNullKeyAbsent() { + assertFalse(multimap().remove(null, v0())); + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUE_QUERIES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUE_QUERIES, SUPPORTS_REMOVE}) + public void testRemoveNullValueAbsent() { + assertFalse(multimap().remove(k0(), null)); + expectUnchanged(); +@@ -117,8 +117,8 @@ public class MultimapRemoveEntryTester extends AbstractMultimapTester> entries = Helpers.copyToList(multimap().entries()); + for (Entry entry : entries) { +@@ -138,8 +138,8 @@ public class MultimapRemoveEntryTester extends AbstractMultimapTester> entries = Helpers.copyToList(multimap().entries()); + for (Entry entry : entries) { +@@ -159,8 +159,8 @@ public class MultimapRemoveEntryTester extends AbstractMultimapTester> entries = Helpers.copyToList(multimap().entries()); + for (Entry entry : entries) { +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapReplaceValuesTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapReplaceValuesTester.java +index 3e2597d8db..5d5b1a7505 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapReplaceValuesTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapReplaceValuesTester.java +@@ -22,6 +22,8 @@ import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_ + import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_PUT; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.emptyList; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Multimap; +@@ -31,7 +33,6 @@ import com.google.common.collect.testing.features.MapFeature; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import org.junit.Ignore; + +@@ -45,7 +46,7 @@ import org.junit.Ignore; + public class MultimapReplaceValuesTester + extends AbstractMultimapTester> { + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testReplaceValuesWithNullValue() { + @SuppressWarnings("unchecked") + List values = Arrays.asList(v0(), null, v3()); +@@ -53,7 +54,7 @@ public class MultimapReplaceValuesTester + assertGet(k0(), values); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testReplaceValuesWithNullKey() { + @SuppressWarnings("unchecked") + List values = Arrays.asList(v0(), v2(), v3()); +@@ -76,7 +77,7 @@ public class MultimapReplaceValuesTester + int size = multimap().size(); + List oldValues = new ArrayList<>(multimap().get(k0())); + @SuppressWarnings("unchecked") +- List values = Collections.emptyList(); ++ List values = emptyList(); + assertEquals(oldValues, new ArrayList(multimap().replaceValues(k0(), values))); + assertGet(k0()); + assertEquals(size - oldValues.size(), multimap().size()); +@@ -119,10 +120,10 @@ public class MultimapReplaceValuesTester + assertContentsAnyOrder(getCollection, v0(), v2(), v3()); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testReplaceValuesRemoveNotSupported() { +- List values = Collections.singletonList(v3()); ++ List values = singletonList(v3()); + try { + multimap().replaceValues(k0(), values); + fail("Expected UnsupportedOperationException"); +@@ -133,7 +134,7 @@ public class MultimapReplaceValuesTester + + @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplaceValuesPutNotSupported() { +- List values = Collections.singletonList(v3()); ++ List values = singletonList(v3()); + try { + multimap().replaceValues(k0(), values); + fail("Expected UnsupportedOperationException"); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapTestSuiteBuilder.java +index af9d261c32..c695687614 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapTestSuiteBuilder.java +@@ -18,6 +18,8 @@ package com.google.common.collect.testing.google; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.collect.testing.Helpers.mapEntry; ++import static java.util.Collections.disjoint; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.ImmutableList; +@@ -44,7 +46,6 @@ import com.google.common.collect.testing.features.MapFeature; + import com.google.common.testing.SerializableTester; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.EnumSet; + import java.util.HashMap; + import java.util.HashSet; +@@ -180,7 +181,7 @@ public class MultimapTestSuiteBuilder> + FeatureSpecificTestSuiteBuilder>> + parentBuilder) { + Set> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures()); +- if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) { ++ if (disjoint(features, EnumSet.allOf(CollectionSize.class))) { + return new TestSuite(); + } else { + return CollectionTestSuiteBuilder.using( +@@ -325,7 +326,7 @@ public class MultimapTestSuiteBuilder> + + private Collection createCollection(V v) { + return ((TestMultimapGenerator) multimapGenerator.getInnerGenerator()) +- .createCollection(Collections.singleton(v)); ++ .createCollection(singleton(v)); + } + + @Override +@@ -357,8 +358,8 @@ public class MultimapTestSuiteBuilder> + return multimapGenerator.create(builder.toArray()).asMap(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Entry>[] createArray(int length) { + return new Entry[length]; + } +@@ -387,8 +388,8 @@ public class MultimapTestSuiteBuilder> + .createKeyArray(length); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Collection[] createValueArray(int length) { + return new Collection[length]; + } +@@ -417,8 +418,8 @@ public class MultimapTestSuiteBuilder> + return multimapGenerator.create(elements).entries(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Entry[] createArray(int length) { + return new Entry[length]; + } +@@ -456,8 +457,8 @@ public class MultimapTestSuiteBuilder> + return multimapGenerator.create((Object[]) entries).values(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public V[] createArray(int length) { + return ((TestMultimapGenerator) multimapGenerator.getInnerGenerator()) + .createValueArray(length); +@@ -527,8 +528,8 @@ public class MultimapTestSuiteBuilder> + .iterator(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public K[] createArray(int length) { + return ((TestMultimapGenerator) multimapGenerator.getInnerGenerator()) + .createKeyArray(length); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultimapToStringTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultimapToStringTester.java +index 203f278b7f..6928ca8e9e 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultimapToStringTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultimapToStringTester.java +@@ -35,28 +35,28 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MultimapToStringTester extends AbstractMultimapTester> { +- @CollectionSize.Require(ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ZERO) + public void testToStringEmpty() { + assertEquals("{}", multimap().toString()); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ONE) + public void testToStringSingleton() { + assertEquals("{" + k0() + "=[" + v0() + "]}", multimap().toString()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(absent = ZERO) + @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testToStringWithNullKey() { + initMultimapWithNullKey(); + testToStringMatchesAsMap(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(absent = ZERO) + @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testToStringWithNullValue() { + initMultimapWithNullValue(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetCountTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetCountTester.java +index 7c07cd33d0..b5028ab81f 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetCountTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetCountTester.java +@@ -70,8 +70,8 @@ public class MultisetCountTester extends AbstractMultisetTester { + } + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + public void testCount_nullPresent() { + initCollectionWithNullElement(); + assertEquals(1, getMultiset().count(null)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetElementSetTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetElementSetTester.java +index baa6071f84..3d01753014 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetElementSetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetElementSetTester.java +@@ -21,6 +21,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.SUPPO + import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_REMOVE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -29,7 +30,6 @@ import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; + import java.lang.reflect.Method; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.Set; + import org.junit.Ignore; +@@ -50,17 +50,17 @@ public class MultisetElementSetTester extends AbstractMultisetTester { + assertTrue(elementSet.contains(e3())); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testElementSetReflectsRemove() { + Set elementSet = getMultiset().elementSet(); + assertTrue(elementSet.contains(e0())); +- getMultiset().removeAll(Collections.singleton(e0())); ++ getMultiset().removeAll(singleton(e0())); + assertFalse(elementSet.contains(e0())); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testElementSetRemovePropagatesToMultiset() { + Set elementSet = getMultiset().elementSet(); + int size = getNumElements(); +@@ -70,8 +70,8 @@ public class MultisetElementSetTester extends AbstractMultisetTester { + assertEquals(expectedSize, getMultiset().size()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testElementSetRemoveDuplicatePropagatesToMultiset() { + initThreeCopies(); + int size = getNumElements(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java +index 3bec616aae..0dd7cbf5b2 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetEntrySetTester.java +@@ -23,6 +23,7 @@ import static com.google.common.collect.testing.features.CollectionSize.ONE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; + import static com.google.common.collect.testing.google.MultisetFeature.ENTRIES_ARE_VIEWS; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Iterables; +@@ -30,7 +31,6 @@ import com.google.common.collect.Multiset; + import com.google.common.collect.Multisets; + import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; +-import java.util.Collections; + import java.util.Iterator; + import org.junit.Ignore; + +@@ -49,8 +49,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertTrue("multiset not empty after entrySet().clear()", getMultiset().isEmpty()); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) ++ @CollectionSize.Require(ONE) + public void testEntrySet_iteratorRemovePropagates() { + Iterator> iterator = getMultiset().entrySet().iterator(); + assertTrue( +@@ -68,8 +68,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + getMultiset().isEmpty()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testEntrySet_removePresent() { + assertTrue( + "multiset.entrySet.remove(presentEntry) returned false", +@@ -77,8 +77,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertFalse("multiset contains element after removing its entry", getMultiset().contains(e0())); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testEntrySet_removeAbsent() { + assertFalse( + "multiset.entrySet.remove(missingEntry) returned true", +@@ -88,58 +88,50 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + getMultiset().contains(e0())); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testEntrySet_removeAllPresent() { + assertTrue( + "multiset.entrySet.removeAll(presentEntry) returned false", +- getMultiset() +- .entrySet() +- .removeAll(Collections.singleton(Multisets.immutableEntry(e0(), 1)))); ++ getMultiset().entrySet().removeAll(singleton(Multisets.immutableEntry(e0(), 1)))); + assertFalse("multiset contains element after removing its entry", getMultiset().contains(e0())); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testEntrySet_removeAllAbsent() { + assertFalse( + "multiset.entrySet.remove(missingEntry) returned true", +- getMultiset() +- .entrySet() +- .removeAll(Collections.singleton(Multisets.immutableEntry(e0(), 2)))); ++ getMultiset().entrySet().removeAll(singleton(Multisets.immutableEntry(e0(), 2)))); + assertTrue( + "multiset didn't contain element after removing a missing entry", + getMultiset().contains(e0())); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(ONE) + public void testEntrySet_retainAllPresent() { + assertFalse( + "multiset.entrySet.retainAll(presentEntry) returned false", +- getMultiset() +- .entrySet() +- .retainAll(Collections.singleton(Multisets.immutableEntry(e0(), 1)))); ++ getMultiset().entrySet().retainAll(singleton(Multisets.immutableEntry(e0(), 1)))); + assertTrue( + "multiset doesn't contains element after retaining its entry", + getMultiset().contains(e0())); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(ONE) + public void testEntrySet_retainAllAbsent() { + assertTrue( + "multiset.entrySet.retainAll(missingEntry) returned true", +- getMultiset() +- .entrySet() +- .retainAll(Collections.singleton(Multisets.immutableEntry(e0(), 2)))); ++ getMultiset().entrySet().retainAll(singleton(Multisets.immutableEntry(e0(), 2)))); + assertFalse( + "multiset contains element after retaining a different entry", + getMultiset().contains(e0())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryViewReflectsRemove() { + initThreeCopies(); +@@ -152,8 +144,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsIteratorRemove() { + initThreeCopies(); +@@ -171,8 +163,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsClear() { + initThreeCopies(); +@@ -183,8 +175,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsEntrySetClear() { + initThreeCopies(); +@@ -195,8 +187,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsEntrySetIteratorRemove() { + initThreeCopies(); +@@ -207,8 +199,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsElementSetClear() { + initThreeCopies(); +@@ -219,8 +211,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) ++ @CollectionSize.Require(SEVERAL) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsElementSetIteratorRemove() { + initThreeCopies(); +@@ -233,8 +225,8 @@ public class MultisetEntrySetTester extends AbstractMultisetTester { + assertEquals(0, entry.getCount()); + } + ++ @CollectionFeature.Require({SUPPORTS_ADD, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) +- @CollectionFeature.Require({SUPPORTS_REMOVE, SUPPORTS_ADD}) + @MultisetFeature.Require(ENTRIES_ARE_VIEWS) + public void testEntryReflectsRemoveThenAdd() { + initThreeCopies(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetEqualsTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetEqualsTester.java +index 9d9fee0a1a..48a65e3eb7 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetEqualsTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetEqualsTester.java +@@ -50,8 +50,8 @@ public class MultisetEqualsTester extends AbstractMultisetTester { + assertEquals(getMultiset().entrySet().hashCode(), getMultiset().hashCode()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + public void testEqualsMultisetWithNullValue() { + new EqualsTester() + .addEqualityGroup(getMultiset()) +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java +index d05c560021..8d741e91d5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetFeature.java +@@ -16,6 +16,8 @@ + + package com.google.common.collect.testing.google; + ++import static java.util.Collections.emptySet; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Multiset; + import com.google.common.collect.testing.features.Feature; +@@ -23,7 +25,6 @@ import com.google.common.collect.testing.features.TesterAnnotation; + import java.lang.annotation.Inherited; + import java.lang.annotation.Retention; + import java.lang.annotation.RetentionPolicy; +-import java.util.Collections; + import java.util.Set; + + /** +@@ -41,7 +42,7 @@ public enum MultisetFeature implements Feature { + + @Override + public Set> getImpliedFeatures() { +- return Collections.emptySet(); ++ return emptySet(); + } + + @Retention(RetentionPolicy.RUNTIME) +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetForEachEntryTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetForEachEntryTester.java +index 50c2ad507a..16ba9472ef 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetForEachEntryTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetForEachEntryTester.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing.google; + + import static com.google.common.collect.testing.features.CollectionFeature.KNOWN_ORDER; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -27,7 +28,6 @@ import com.google.common.collect.testing.features.CollectionFeature; + import java.lang.reflect.Method; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.Ignore; + +@@ -58,7 +58,7 @@ public class MultisetForEachEntryTester extends AbstractMultisetTester { + + public void testForEachEntryDuplicates() { + initThreeCopies(); +- List> expected = Collections.singletonList(Multisets.immutableEntry(e0(), 3)); ++ List> expected = singletonList(Multisets.immutableEntry(e0(), 3)); + List> actual = new ArrayList<>(); + getMultiset() + .forEachEntry((element, count) -> actual.add(Multisets.immutableEntry(element, count))); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetIteratorTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetIteratorTester.java +index 34a8c72585..7940da3f37 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetIteratorTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetIteratorTester.java +@@ -39,8 +39,8 @@ import org.junit.Ignore; + @GwtCompatible(emulated = true) + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MultisetIteratorTester extends AbstractMultisetTester { ++ @CollectionFeature.Require({KNOWN_ORDER, SUPPORTS_ITERATOR_REMOVE}) + @SuppressWarnings("unchecked") +- @CollectionFeature.Require({SUPPORTS_ITERATOR_REMOVE, KNOWN_ORDER}) + public void testRemovingIteratorKnownOrder() { + new IteratorTester( + 4, +@@ -54,8 +54,8 @@ public class MultisetIteratorTester extends AbstractMultisetTester { + }.test(); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(value = SUPPORTS_ITERATOR_REMOVE, absent = KNOWN_ORDER) ++ @SuppressWarnings("unchecked") + public void testRemovingIteratorUnknownOrder() { + new IteratorTester( + 4, +@@ -69,8 +69,8 @@ public class MultisetIteratorTester extends AbstractMultisetTester { + }.test(); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(value = KNOWN_ORDER, absent = SUPPORTS_ITERATOR_REMOVE) ++ @SuppressWarnings("unchecked") + public void testIteratorKnownOrder() { + new IteratorTester( + 4, +@@ -84,8 +84,8 @@ public class MultisetIteratorTester extends AbstractMultisetTester { + }.test(); + } + ++ @CollectionFeature.Require(absent = {KNOWN_ORDER, SUPPORTS_ITERATOR_REMOVE}) + @SuppressWarnings("unchecked") +- @CollectionFeature.Require(absent = {SUPPORTS_ITERATOR_REMOVE, KNOWN_ORDER}) + public void testIteratorUnknownOrder() { + new IteratorTester( + 4, +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetNavigationTester.java +index ce8e283a9c..07949eb72a 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetNavigationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetNavigationTester.java +@@ -22,6 +22,8 @@ import static com.google.common.collect.testing.features.CollectionFeature.SUPPO + import static com.google.common.collect.testing.features.CollectionSize.ONE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; ++import static java.util.Collections.reverse; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.BoundType; +@@ -167,9 +169,9 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(a, sortedMultiset.firstEntry()); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @SuppressWarnings("unchecked") + public void testPollFirst() { + assertEquals(a, sortedMultiset.pollFirstEntry()); + assertEquals(Arrays.asList(b, c), copyToList(sortedMultiset.entrySet())); +@@ -222,9 +224,9 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(c, sortedMultiset.lastEntry()); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @SuppressWarnings("unchecked") + public void testPollLast() { + assertEquals(c, sortedMultiset.pollLastEntry()); + assertEquals(Arrays.asList(a, b), copyToList(sortedMultiset.entrySet())); +@@ -246,7 +248,7 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + Iterators.addAll(ascending, sortedMultiset.entrySet().iterator()); + List> descending = new ArrayList<>(); + Iterators.addAll(descending, sortedMultiset.descendingMultiset().entrySet().iterator()); +- Collections.reverse(descending); ++ reverse(descending); + assertEquals(ascending, descending); + } + +@@ -264,7 +266,7 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + } + + try { +- multiset.addAll(Collections.singletonList(entry.getElement())); ++ multiset.addAll(singletonList(entry.getElement())); + fail("Expected IllegalArgumentException"); + } catch (IllegalArgumentException expected) { + } +@@ -288,14 +290,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + } + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(ONE) + public void testAddOutOfTailBoundsOne() { + expectAddFailure(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testAddOutOfTailBoundsSeveral() { + expectAddFailure(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + expectAddFailure(sortedMultiset.tailMultiset(b.getElement(), CLOSED), a); +@@ -308,14 +310,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectAddFailure(sortedMultiset.tailMultiset(c.getElement(), OPEN), c); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(ONE) + public void testAddOutOfHeadBoundsOne() { + expectAddFailure(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testAddOutOfHeadBoundsSeveral() { + expectAddFailure(sortedMultiset.headMultiset(c.getElement(), OPEN), c); + expectAddFailure(sortedMultiset.headMultiset(b.getElement(), CLOSED), c); +@@ -328,14 +330,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectAddFailure(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(ONE) + public void testRemoveOutOfTailBoundsOne() { + expectRemoveZero(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testRemoveOutOfTailBoundsSeveral() { + expectRemoveZero(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + expectRemoveZero(sortedMultiset.tailMultiset(b.getElement(), CLOSED), a); +@@ -348,14 +350,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectRemoveZero(sortedMultiset.tailMultiset(c.getElement(), OPEN), c); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(ONE) + public void testRemoveOutOfHeadBoundsOne() { + expectRemoveZero(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testRemoveOutOfHeadBoundsSeveral() { + expectRemoveZero(sortedMultiset.headMultiset(c.getElement(), OPEN), c); + expectRemoveZero(sortedMultiset.headMultiset(b.getElement(), CLOSED), c); +@@ -368,14 +370,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectRemoveZero(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require({SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(ONE) + public void testSetCountOutOfTailBoundsOne() { + expectSetCountFailure(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require({SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(SEVERAL) + public void testSetCountOutOfTailBoundsSeveral() { + expectSetCountFailure(sortedMultiset.tailMultiset(a.getElement(), OPEN), a); + expectSetCountFailure(sortedMultiset.tailMultiset(b.getElement(), CLOSED), a); +@@ -388,14 +390,14 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectSetCountFailure(sortedMultiset.tailMultiset(c.getElement(), OPEN), c); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require({SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(ONE) + public void testSetCountOutOfHeadBoundsOne() { + expectSetCountFailure(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require({SUPPORTS_ADD, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(SEVERAL) + public void testSetCountOutOfHeadBoundsSeveral() { + expectSetCountFailure(sortedMultiset.headMultiset(c.getElement(), OPEN), c); + expectSetCountFailure(sortedMultiset.headMultiset(b.getElement(), CLOSED), c); +@@ -408,8 +410,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + expectSetCountFailure(sortedMultiset.headMultiset(a.getElement(), OPEN), a); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testAddWithConflictingBounds() { + testEmptyRangeSubMultisetSupportingAdd( + sortedMultiset.subMultiset(a.getElement(), CLOSED, a.getElement(), OPEN)); +@@ -425,8 +427,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + sortedMultiset.subMultiset(b.getElement(), OPEN, a.getElement(), OPEN)); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testConflictingBounds() { + testEmptyRangeSubMultiset( + sortedMultiset.subMultiset(a.getElement(), CLOSED, a.getElement(), OPEN)); +@@ -600,8 +602,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + testSubMultisetDistinctElements(SubMultisetSpec.HEAD_OPEN); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearTailOpen() { + List> expected = + copyToList(sortedMultiset.headMultiset(b.getElement(), CLOSED).entrySet()); +@@ -609,8 +611,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearTailOpenEntrySet() { + List> expected = + copyToList(sortedMultiset.headMultiset(b.getElement(), CLOSED).entrySet()); +@@ -618,8 +620,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearTailClosed() { + List> expected = + copyToList(sortedMultiset.headMultiset(b.getElement(), OPEN).entrySet()); +@@ -627,8 +629,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearTailClosedEntrySet() { + List> expected = + copyToList(sortedMultiset.headMultiset(b.getElement(), OPEN).entrySet()); +@@ -636,8 +638,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearHeadOpen() { + List> expected = + copyToList(sortedMultiset.tailMultiset(b.getElement(), CLOSED).entrySet()); +@@ -645,8 +647,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearHeadOpenEntrySet() { + List> expected = + copyToList(sortedMultiset.tailMultiset(b.getElement(), CLOSED).entrySet()); +@@ -654,8 +656,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearHeadClosed() { + List> expected = + copyToList(sortedMultiset.tailMultiset(b.getElement(), OPEN).entrySet()); +@@ -663,8 +665,8 @@ public class MultisetNavigationTester extends AbstractMultisetTester { + assertEquals(expected, copyToList(sortedMultiset.entrySet())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testClearHeadClosedEntrySet() { + List> expected = + copyToList(sortedMultiset.tailMultiset(b.getElement(), OPEN).entrySet()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java +index e6594c18a2..97258d8694 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetRemoveTester.java +@@ -22,6 +22,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.ALLOW + import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_REMOVE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -31,7 +32,6 @@ import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; + import java.lang.reflect.Method; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.Ignore; + +@@ -70,8 +70,8 @@ public class MultisetRemoveTester extends AbstractMultisetTester { + expectUnchanged(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(absent = ZERO) + public void testRemove_occurrences_present() { + assertEquals( + "multiset.remove(present, 2) didn't return the old count", +@@ -83,8 +83,8 @@ public class MultisetRemoveTester extends AbstractMultisetTester { + assertEquals(0, getMultiset().count(e0())); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testRemove_some_occurrences_present() { + initThreeCopies(); + assertEquals( +@@ -142,8 +142,8 @@ public class MultisetRemoveTester extends AbstractMultisetTester { + getMultiset().remove(WrongType.VALUE, 1)); + } + ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) + public void testRemove_nullPresent() { + initCollectionWithNullElement(); + assertEquals(1, getMultiset().remove(null, 2)); +@@ -153,7 +153,7 @@ public class MultisetRemoveTester extends AbstractMultisetTester { + assertEquals(0, getMultiset().count(null)); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_QUERIES}) ++ @CollectionFeature.Require({ALLOWS_NULL_QUERIES, SUPPORTS_REMOVE}) + public void testRemove_nullAbsent() { + assertEquals(0, getMultiset().remove(null, 2)); + } +@@ -167,20 +167,20 @@ public class MultisetRemoveTester extends AbstractMultisetTester { + } + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testRemoveAllIgnoresCount() { + initThreeCopies(); +- assertTrue(getMultiset().removeAll(Collections.singleton(e0()))); ++ assertTrue(getMultiset().removeAll(singleton(e0()))); + assertEmpty(getMultiset()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_REMOVE) ++ @CollectionSize.Require(SEVERAL) + public void testRetainAllIgnoresCount() { + initThreeCopies(); + List contents = Helpers.copyToList(getMultiset()); +- assertFalse(getMultiset().retainAll(Collections.singleton(e0()))); ++ assertFalse(getMultiset().retainAll(singleton(e0()))); + expectContents(contents); + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java +index d5e69638f4..781b6359cb 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java +@@ -84,8 +84,8 @@ public class MultisetSetCountConditionallyTester extends AbstractMultisetSetC + expectUnchanged(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(absent = ZERO) + public void testSetCountConditional_oldCountTooSmallZero() { + assertFalse( + "setCount() with a too-small oldCount should return false", +@@ -93,8 +93,8 @@ public class MultisetSetCountConditionallyTester extends AbstractMultisetSetC + expectUnchanged(); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(SUPPORTS_ADD) ++ @CollectionSize.Require(SEVERAL) + public void testSetCountConditional_oldCountTooSmallNonzero() { + initThreeCopies(); + assertFalse( +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java +index 91d7a60e70..87b4b3aaf5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java +@@ -17,6 +17,7 @@ + package com.google.common.collect.testing.google; + + import static com.google.common.base.Preconditions.checkArgument; ++import static java.util.Collections.emptySet; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.Multiset; +@@ -36,7 +37,6 @@ import com.google.common.collect.testing.testers.CollectionSerializationEqualTes + import com.google.common.testing.SerializableTester; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashSet; + import java.util.LinkedHashMap; + import java.util.LinkedHashSet; +@@ -64,7 +64,7 @@ public class MultisetTestSuiteBuilder + + @Override + public Set> getImpliedFeatures() { +- return Collections.emptySet(); ++ return emptySet(); + } + } + +@@ -230,8 +230,8 @@ public class MultisetTestSuiteBuilder + return ((Multiset) gen.create(contents.toArray())).entrySet(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Multiset.Entry[] createArray(int length) { + return new Multiset.Entry[length]; + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java +index 0b55a2798a..7937f7052d 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java +@@ -23,6 +23,7 @@ import static com.google.common.collect.testing.SampleElements.Strings.AFTER_LAS + import static com.google.common.collect.testing.SampleElements.Strings.AFTER_LAST_2; + import static com.google.common.collect.testing.SampleElements.Strings.BEFORE_FIRST; + import static com.google.common.collect.testing.SampleElements.Strings.BEFORE_FIRST_2; ++import static java.util.Collections.reverseOrder; + import static junit.framework.Assert.assertEquals; + + import com.google.common.annotations.GwtCompatible; +@@ -129,8 +130,8 @@ public class SetGenerators { + public static class DegeneratedImmutableSetGenerator extends TestStringSetGenerator { + // Make sure we get what we think we're getting, or else this test + // is pointless +- @SuppressWarnings("cast") + @Override ++ @SuppressWarnings("cast") + protected Set create(String[] elements) { + return (ImmutableSet) ImmutableSet.of(elements[0], elements[0]); + } +@@ -181,7 +182,7 @@ public class SetGenerators { + + public static class ImmutableSortedSetExplicitComparator extends TestStringSetGenerator { + +- private static final Comparator STRING_REVERSED = Collections.reverseOrder(); ++ private static final Comparator STRING_REVERSED = reverseOrder(); + + @Override + protected SortedSet create(String[] elements) { +@@ -190,7 +191,7 @@ public class SetGenerators { + + @Override + public List order(List insertionOrder) { +- Collections.sort(insertionOrder, Collections.reverseOrder()); ++ Collections.sort(insertionOrder, reverseOrder()); + return insertionOrder; + } + } +@@ -198,7 +199,7 @@ public class SetGenerators { + public static class ImmutableSortedSetExplicitSuperclassComparatorGenerator + extends TestStringSetGenerator { + +- private static final Comparator> COMPARABLE_REVERSED = Collections.reverseOrder(); ++ private static final Comparator> COMPARABLE_REVERSED = reverseOrder(); + + @Override + protected SortedSet create(String[] elements) { +@@ -207,7 +208,7 @@ public class SetGenerators { + + @Override + public List order(List insertionOrder) { +- Collections.sort(insertionOrder, Collections.reverseOrder()); ++ Collections.sort(insertionOrder, reverseOrder()); + return insertionOrder; + } + } +@@ -223,7 +224,7 @@ public class SetGenerators { + + @Override + public List order(List insertionOrder) { +- Collections.sort(insertionOrder, Collections.reverseOrder()); ++ Collections.sort(insertionOrder, reverseOrder()); + return insertionOrder; + } + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SetMultimapAsMapTester.java b/guava-testlib/src/com/google/common/collect/testing/google/SetMultimapAsMapTester.java +index 6e79957208..6a20f854cf 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/SetMultimapAsMapTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/SetMultimapAsMapTester.java +@@ -16,6 +16,8 @@ package com.google.common.collect.testing.google; + + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.singleton; ++import static java.util.Collections.singletonMap; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.Maps; +@@ -27,7 +29,6 @@ import com.google.common.collect.testing.features.MapFeature; + import com.google.common.testing.EqualsTester; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import java.util.Map; + import java.util.Map.Entry; +@@ -90,8 +91,8 @@ public class SetMultimapAsMapTester extends AbstractMultimapTester extends AbstractMultimapTester> { + // Tests for non-duplicate values are in MultimapPutTester + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testPutDuplicateValuePreservesSize() { + assertFalse(multimap().put(k0(), v0())); + assertEquals(getNumElements(), multimap().size()); +@@ -64,8 +64,8 @@ public class SetMultimapPutTester extends AbstractMultimapTester + ?, ? extends OneSizeTestContainerGenerator, Entry>> + parentBuilder) { + Set> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures()); +- if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) { ++ if (disjoint(features, EnumSet.allOf(CollectionSize.class))) { + return new TestSuite(); + } else { + return SetTestSuiteBuilder.using( +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SortedMapGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/SortedMapGenerators.java +index 424fbb17ef..1283a012d9 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/SortedMapGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/SortedMapGenerators.java +@@ -76,8 +76,8 @@ public class SortedMapGenerators { + mapEntry("toaster", -2)); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Entry[] createArray(int length) { + return new Entry[length]; + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SortedMultisetTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/SortedMultisetTestSuiteBuilder.java +index b44494b81d..740c24f071 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/SortedMultisetTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/SortedMultisetTestSuiteBuilder.java +@@ -20,6 +20,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.KNOWN + import static com.google.common.collect.testing.features.CollectionFeature.RESTRICTS_ELEMENTS; + import static com.google.common.collect.testing.features.CollectionFeature.SERIALIZABLE; + import static com.google.common.collect.testing.features.CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS; ++import static java.util.Collections.emptySet; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.BoundType; +@@ -101,7 +102,7 @@ public class SortedMultisetTestSuiteBuilder extends MultisetTestSuiteBuilder< + + @Override + public Set> getImpliedFeatures() { +- return Collections.emptySet(); ++ return emptySet(); + } + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapTestSuiteBuilder.java b/guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapTestSuiteBuilder.java +index 66c5a8ed09..a110aed1b1 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapTestSuiteBuilder.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/SortedSetMultimapTestSuiteBuilder.java +@@ -16,6 +16,8 @@ + + package com.google.common.collect.testing.google; + ++import static java.util.Collections.disjoint; ++ + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.SetMultimap; + import com.google.common.collect.testing.AbstractTester; +@@ -25,7 +27,6 @@ import com.google.common.collect.testing.OneSizeTestContainerGenerator; + import com.google.common.collect.testing.SortedSetTestSuiteBuilder; + import com.google.common.collect.testing.features.CollectionSize; + import com.google.common.collect.testing.features.Feature; +-import java.util.Collections; + import java.util.EnumSet; + import java.util.List; + import java.util.Map.Entry; +@@ -82,7 +83,7 @@ public class SortedSetMultimapTestSuiteBuilder + ?, ? extends OneSizeTestContainerGenerator, Entry>> + parentBuilder) { + Set> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures()); +- if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) { ++ if (disjoint(features, EnumSet.allOf(CollectionSize.class))) { + return new TestSuite(); + } else { + return SortedSetTestSuiteBuilder.using( +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java b/guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java +index 40b2c859d2..cfd17ad666 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java +@@ -16,6 +16,8 @@ + + package com.google.common.collect.testing.google; + ++import static java.util.Collections.singleton; ++import static java.util.Collections.unmodifiableList; + import static junit.framework.TestCase.assertEquals; + import static junit.framework.TestCase.assertTrue; + import static junit.framework.TestCase.fail; +@@ -30,7 +32,6 @@ import com.google.common.collect.Multimap; + import com.google.common.collect.Multiset; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; + import java.util.Map.Entry; +@@ -265,12 +266,11 @@ public class UnmodifiableCollectionTests { + */ + public static void assertMultimapIsUnmodifiable( + Multimap multimap, K sampleKey, V sampleValue) { +- List> originalEntries = +- Collections.unmodifiableList(Lists.newArrayList(multimap.entries())); ++ List> originalEntries = unmodifiableList(Lists.newArrayList(multimap.entries())); + + assertMultimapRemainsUnmodified(multimap, originalEntries); + +- Collection sampleValueAsCollection = Collections.singleton(sampleValue); ++ Collection sampleValueAsCollection = singleton(sampleValue); + + // Test #clear() + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddAllTester.java +index 5c21c9a931..81b127e298 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddAllTester.java +@@ -102,7 +102,7 @@ public class CollectionAddAllTester extends AbstractCollectionTester { + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_ADD, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_ADD}) + @CollectionSize.Require(absent = ZERO) + public void testAddAllConcurrentWithIteration() { + try { +@@ -128,7 +128,7 @@ public class CollectionAddAllTester extends AbstractCollectionTester { + } + + @CollectionFeature.Require( +- value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES}, ++ value = {ALLOWS_NULL_VALUES, SUPPORTS_ADD}, + absent = RESTRICTS_ELEMENTS) + public void testAddAll_nullSupported() { + List containsNull = singletonList(null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddTester.java +index bed257c976..4c3d01319b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionAddTester.java +@@ -72,7 +72,7 @@ public class CollectionAddTester extends AbstractCollectionTester { + } + + @CollectionFeature.Require( +- value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES}, ++ value = {ALLOWS_NULL_VALUES, SUPPORTS_ADD}, + absent = RESTRICTS_ELEMENTS) + public void testAdd_nullSupported() { + assertTrue("add(null) should return true", collection.add(null)); +@@ -90,7 +90,7 @@ public class CollectionAddTester extends AbstractCollectionTester { + expectNullMissingWhenNullUnsupported("Should not contain null after unsupported add(null)"); + } + +- @CollectionFeature.Require({SUPPORTS_ADD, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_ADD}) + @CollectionSize.Require(absent = ZERO) + public void testAddConcurrentWithIteration() { + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionClearTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionClearTester.java +index 9b97fff73e..37030781eb 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionClearTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionClearTester.java +@@ -69,7 +69,7 @@ public class CollectionClearTester extends AbstractCollectionTester { + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) + public void testClearConcurrentWithIteration() { + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveAllTester.java +index 0d59097377..ab9ad93aff 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveAllTester.java +@@ -22,6 +22,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.FAILS + import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_REMOVE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.collect.testing.AbstractCollectionTester; +@@ -29,7 +30,6 @@ import com.google.common.collect.testing.MinimalCollection; + import com.google.common.collect.testing.WrongType; + import com.google.common.collect.testing.features.CollectionFeature; + import com.google.common.collect.testing.features.CollectionSize; +-import java.util.Collections; + import java.util.ConcurrentModificationException; + import java.util.Iterator; + import org.junit.Ignore; +@@ -79,7 +79,7 @@ public class CollectionRemoveAllTester extends AbstractCollectionTester { + expectMissing(e0()); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) + public void testRemoveAllSomePresentConcurrentWithIteration() { + try { +@@ -177,20 +177,18 @@ public class CollectionRemoveAllTester extends AbstractCollectionTester { + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_QUERIES}) ++ @CollectionFeature.Require({ALLOWS_NULL_QUERIES, SUPPORTS_REMOVE}) + public void testRemoveAll_containsNullNoButAllowed() { + MinimalCollection containsNull = MinimalCollection.of((Object) null); + assertFalse("removeAll(containsNull) should return false", collection.removeAll(containsNull)); + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) + public void testRemoveAll_containsNullYes() { + initCollectionWithNullElement(); +- assertTrue( +- "removeAll(containsNull) should return true", +- collection.removeAll(Collections.singleton(null))); ++ assertTrue("removeAll(containsNull) should return true", collection.removeAll(singleton(null))); + // TODO: make this work with MinimalCollection + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveIfTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveIfTester.java +index bc0139f841..170aaf3bf8 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveIfTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveIfTester.java +@@ -64,7 +64,7 @@ public class CollectionRemoveIfTester extends AbstractCollectionTester { + expectContents(); + } + +- @CollectionFeature.Require({SUPPORTS_ITERATOR_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_ITERATOR_REMOVE}) + @CollectionSize.Require(SEVERAL) + public void testRemoveIfSomeMatchesConcurrentWithIteration() { + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveTester.java +index 49568fc280..be8e2c02d8 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRemoveTester.java +@@ -54,7 +54,7 @@ public class CollectionRemoveTester extends AbstractCollectionTester { + expectMissing(e0()); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, FAILS_FAST_ON_CONCURRENT_MODIFICATION}) ++ @CollectionFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) + public void testRemovePresentConcurrentWithIteration() { + try { +@@ -73,7 +73,7 @@ public class CollectionRemoveTester extends AbstractCollectionTester { + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) + public void testRemove_nullPresent() { + collection = getSubjectGenerator().create(createArrayWithNullElement()); +@@ -122,7 +122,7 @@ public class CollectionRemoveTester extends AbstractCollectionTester { + expectUnchanged(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_QUERIES}) ++ @CollectionFeature.Require({ALLOWS_NULL_QUERIES, SUPPORTS_REMOVE}) + public void testRemove_nullAllowed() { + assertFalse("remove(null) should return false", collection.remove(null)); + expectUnchanged(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRetainAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRetainAllTester.java +index db7aef1392..1d5c1b5dc5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRetainAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionRetainAllTester.java +@@ -169,14 +169,14 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + // retainAll(subset) + + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_subset() { + expectReturnsTrue(nonEmptyProperSubset); + expectContents(nonEmptyProperSubset.toRetain); + } + + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_subsetUnsupported() { + expectThrows(nonEmptyProperSubset); + expectUnchanged(); +@@ -199,14 +199,14 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + // retainAll(partialOverlap) + + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_partialOverlap() { + expectReturnsTrue(partialOverlap); + expectContents(e2()); + } + + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_partialOverlapUnsupported() { + expectThrows(partialOverlap); + expectUnchanged(); +@@ -222,7 +222,7 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + } + + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_containsDuplicatesSizeSeveral() { + expectReturnsTrue(containsDuplicates); + expectContents(e0()); +@@ -244,7 +244,7 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + expectContents(); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(ONE) + public void testRetainAll_nullSingletonPreviouslySingletonWithNull() { + initCollectionWithNullElement(); +@@ -252,8 +252,8 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + expectContents(createArrayWithNullElement()); + } + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_nullSingletonPreviouslySeveralWithNull() { + initCollectionWithNullElement(); + expectReturnsTrue(nullSingleton); +@@ -262,7 +262,7 @@ public class CollectionRetainAllTester extends AbstractCollectionTester { + + // nullSingleton.retainAll() + +- @CollectionFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) + public void testRetainAll_containsNonNullWithNull() { + initCollectionWithNullElement(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionToStringTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionToStringTester.java +index f138ccfa91..232fa4c475 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/CollectionToStringTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/CollectionToStringTester.java +@@ -43,14 +43,14 @@ public class CollectionToStringTester extends AbstractCollectionTester { + assertNotNull("toString() should not return null", collection.toString()); + } + +- @CollectionSize.Require(ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ZERO) + public void testToString_size0() { + assertEquals("emptyCollection.toString should return []", "[]", collection.toString()); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ONE) + public void testToString_size1() { + assertEquals( + "size1Collection.toString should return [{element}]", +@@ -58,15 +58,15 @@ public class CollectionToStringTester extends AbstractCollectionTester { + collection.toString()); + } + +- @CollectionSize.Require(SEVERAL) + @CollectionFeature.Require(value = KNOWN_ORDER, absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(SEVERAL) + public void testToString_sizeSeveral() { + String expected = Helpers.copyToList(getOrderedElements()).toString(); + assertEquals("collection.toString() incorrect", expected, collection.toString()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + public void testToString_null() { + initCollectionWithNullElement(); + testToString_minimal(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java +index 6cf5be2327..b287460601 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java +@@ -50,8 +50,8 @@ public class ConcurrentMapPutIfAbsentTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester { + return (ConcurrentMap) super.getMap(); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testRemove_supportedPresent() { + assertTrue(getMap().remove(k0(), v0())); + expectMissing(e0()); +@@ -87,8 +87,8 @@ public class ConcurrentMapRemoveTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testRemove_unsupportedPresent() { + try { + getMap().remove(k0(), v0()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapReplaceEntryTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapReplaceEntryTester.java +index 57f631cd8b..eb4cb98f57 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapReplaceEntryTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapReplaceEntryTester.java +@@ -43,22 +43,22 @@ public class ConcurrentMapReplaceEntryTester extends AbstractMapTester) super.getMap(); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedPresent() { + assertTrue(getMap().replace(k0(), v0(), v3())); + expectReplacement(entry(k0(), v3())); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedPresentUnchanged() { + assertTrue(getMap().replace(k0(), v0(), v0())); + expectUnchanged(); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedWrongValue() { + assertFalse(getMap().replace(k0(), v3(), v4())); + expectUnchanged(); +@@ -70,8 +70,8 @@ public class ConcurrentMapReplaceEntryTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester extends AbstractMapTester { + return (ConcurrentMap) super.getMap(); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplace_supportedPresent() { + assertEquals(v0(), getMap().replace(k0(), v3())); + expectReplacement(entry(k0(), v3())); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplace_supportedPresentNoChange() { + assertEquals(v0(), getMap().replace(k0(), v0())); + expectUnchanged(); +@@ -64,8 +64,8 @@ public class ConcurrentMapReplaceTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testReplace_presentNullValueUnsupported() { + try { + getMap().replace(k0(), null); +@@ -95,8 +95,8 @@ public class ConcurrentMapReplaceTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplace_unsupportedPresent() { + try { + getMap().replace(k0(), v3()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java +index c3e338f1a4..cf8fcad8ef 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java +@@ -40,8 +40,8 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListAddAllAtIndexTester extends AbstractListTester { +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_supportedAllPresent() { + assertTrue( + "addAll(n, allPresent) should return true", +@@ -49,8 +49,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectAdded(0, e0()); + } + +- @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_unsupportedAllPresent() { + try { + getList().addAll(0, MinimalCollection.of(e0())); +@@ -60,8 +60,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectUnchanged(); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_supportedSomePresent() { + assertTrue( + "addAll(n, allPresent) should return true", +@@ -69,8 +69,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectAdded(0, e0(), e3()); + } + +- @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_unsupportedSomePresent() { + try { + getList().addAll(0, MinimalCollection.of(e0(), e3())); +@@ -105,8 +105,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectAdded(0, e0(), e1(), e0(), e1()); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_nullSupported() { + List containsNull = singletonList(null); + assertTrue("addAll(n, containsNull) should return true", getList().addAll(0, containsNull)); +@@ -117,8 +117,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectAdded(0, (E) null); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionFeature.Require(absent = ALLOWS_NULL_VALUES) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_nullUnsupported() { + List containsNull = singletonList(null); + try { +@@ -131,8 +131,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + "Should not contain null after unsupported addAll(n, containsNull)"); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testAddAllAtIndex_middle() { + assertTrue( + "addAll(middle, disjoint) should return true", +@@ -140,8 +140,8 @@ public class ListAddAllAtIndexTester extends AbstractListTester { + expectAdded(getNumElements() / 2, createDisjointCollection()); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAllAtIndex_end() { + assertTrue( + "addAll(end, disjoint) should return true", +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAtIndexTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAtIndexTester.java +index 32310b8d38..c474b17d57 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAtIndexTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAtIndexTester.java +@@ -43,15 +43,15 @@ import org.junit.Ignore; + @GwtCompatible(emulated = true) + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListAddAtIndexTester extends AbstractListTester { +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAtIndex_supportedPresent() { + getList().add(0, e0()); + expectAdded(0, e0()); + } + +- @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX) + /* + * absent = ZERO isn't required, since unmodList.add() must + * throw regardless, but it keeps the method name accurate. +@@ -95,29 +95,29 @@ public class ListAddAtIndexTester extends AbstractListTester { + expectMissing(e3()); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testAddAtIndex_middle() { + getList().add(getNumElements() / 2, e3()); + expectAdded(getNumElements() / 2, e3()); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAtIndex_end() { + getList().add(getNumElements(), e3()); + expectAdded(getNumElements(), e3()); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAtIndex_nullSupported() { + getList().add(0, null); + expectAdded(0, (E) null); + } + +- @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + @CollectionFeature.Require(absent = ALLOWS_NULL_VALUES) ++ @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) + public void testAddAtIndex_nullUnsupported() { + try { + getList().add(0, null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddTester.java +index 8559d3464d..9aed7261f2 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListAddTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListAddTester.java +@@ -60,7 +60,7 @@ public class ListAddTester extends AbstractListTester { + } + } + +- @CollectionFeature.Require(value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_ADD}) + @CollectionSize.Require(absent = ZERO) + public void testAdd_supportedNullPresent() { + E[] array = createArrayWithNullElement(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListCreationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListCreationTester.java +index 9d0b77ab2d..9e17e75b7b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListCreationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListCreationTester.java +@@ -36,7 +36,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListCreationTester extends AbstractListTester { + @CollectionFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testCreateWithDuplicates() { + E[] array = createSamplesArray(); + array[1] = e0(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListEqualsTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListEqualsTester.java +index 3a09586f80..c5a837ca66 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListEqualsTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListEqualsTester.java +@@ -59,8 +59,8 @@ public class ListEqualsTester extends AbstractListTester { + getList().equals(other)); + } + +- @CollectionSize.Require(absent = CollectionSize.ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = CollectionSize.ZERO) + public void testEquals_containingNull() { + ArrayList elements = new ArrayList<>(getSampleElements()); + elements.set(elements.size() / 2, null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListIndexOfTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListIndexOfTester.java +index 7afb8c8281..c3443859cc 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListIndexOfTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListIndexOfTester.java +@@ -45,7 +45,7 @@ public class ListIndexOfTester extends AbstractListIndexOfTester { + } + + @CollectionFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testIndexOf_duplicate() { + E[] array = createSamplesArray(); + array[getNumElements() / 2] = e0(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListLastIndexOfTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListLastIndexOfTester.java +index 19f7f1e123..ec3148eba6 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListLastIndexOfTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListLastIndexOfTester.java +@@ -45,7 +45,7 @@ public class ListLastIndexOfTester extends AbstractListIndexOfTester { + } + + @CollectionFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testLastIndexOf_duplicate() { + E[] array = createSamplesArray(); + array[getNumElements() / 2] = e0(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java +index 0d4b13e684..64c723cbd7 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java +@@ -49,7 +49,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListListIteratorTester extends AbstractListTester { + @CollectionFeature.Require(absent = SUPPORTS_REMOVE) +- @ListFeature.Require(absent = {SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX}) ++ @ListFeature.Require(absent = {SUPPORTS_ADD_WITH_INDEX, SUPPORTS_SET}) + public void testListIterator_unmodifiable() { + runListIteratorTest(UNMODIFIABLE); + } +@@ -59,7 +59,7 @@ public class ListListIteratorTester extends AbstractListTester { + * modification operations. + */ + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @ListFeature.Require({SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX}) ++ @ListFeature.Require({SUPPORTS_ADD_WITH_INDEX, SUPPORTS_SET}) + public void testListIterator_fullyModifiable() { + runListIteratorTest(MODIFIABLE); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAllTester.java +index 513134cd44..90f141b7b5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAllTester.java +@@ -37,7 +37,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListRemoveAllTester extends AbstractListTester { + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRemoveAll_duplicate() { + ArrayWithDuplicate arrayAndDuplicate = createArrayWithDuplicateElement(); + collection = getSubjectGenerator().create(arrayAndDuplicate.elements); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAtIndexTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAtIndexTester.java +index 9714251527..f7e5e74666 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAtIndexTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveAtIndexTester.java +@@ -40,8 +40,8 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListRemoveAtIndexTester extends AbstractListTester { +- @ListFeature.Require(absent = SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(absent = SUPPORTS_REMOVE_WITH_INDEX) + public void testRemoveAtIndex_unsupported() { + try { + getList().remove(0); +@@ -71,21 +71,21 @@ public class ListRemoveAtIndexTester extends AbstractListTester { + expectUnchanged(); + } + +- @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + public void testRemoveAtIndex_first() { + runRemoveTest(0); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testRemoveAtIndex_middle() { + runRemoveTest(getNumElements() / 2); + } + + @CollectionFeature.Require(FAILS_FAST_ON_CONCURRENT_MODIFICATION) +- @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + public void testRemoveAtIndexConcurrentWithIteration() { + try { + Iterator iterator = collection.iterator(); +@@ -97,8 +97,8 @@ public class ListRemoveAtIndexTester extends AbstractListTester { + } + } + +- @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + public void testRemoveAtIndex_last() { + runRemoveTest(getNumElements() - 1); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveTester.java +index 9c2c688aba..8b117fb565 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListRemoveTester.java +@@ -35,7 +35,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListRemoveTester extends AbstractListTester { + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRemove_duplicate() { + ArrayWithDuplicate arrayAndDuplicate = createArrayWithDuplicateElement(); + collection = getSubjectGenerator().create(arrayAndDuplicate.elements); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListRetainAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListRetainAllTester.java +index 96bd3b4004..655f398b73 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListRetainAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListRetainAllTester.java +@@ -39,7 +39,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListRetainAllTester extends AbstractListTester { + @CollectionFeature.Require(SUPPORTS_REMOVE) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testRetainAll_duplicatesKept() { + E[] array = createSamplesArray(); + array[1] = e0(); +@@ -50,9 +50,9 @@ public class ListRetainAllTester extends AbstractListTester { + expectContents(array); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @SuppressWarnings("unchecked") + public void testRetainAll_duplicatesRemoved() { + E[] array = createSamplesArray(); + array[1] = e0(); +@@ -63,9 +63,9 @@ public class ListRetainAllTester extends AbstractListTester { + expectContents(e2()); + } + +- @SuppressWarnings("unchecked") + @CollectionFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @SuppressWarnings("unchecked") + public void testRetainAll_countIgnored() { + resetContainer(getSubjectGenerator().create(e0(), e2(), e1(), e0())); + assertTrue(getList().retainAll(Arrays.asList(e0(), e1()))); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListSetTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListSetTester.java +index 844f1b4d60..924a7605aa 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListSetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListSetTester.java +@@ -38,21 +38,21 @@ import org.junit.Ignore; + @GwtCompatible(emulated = true) + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class ListSetTester extends AbstractListTester { +- @ListFeature.Require(SUPPORTS_SET) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_SET) + public void testSet() { + doTestSet(e3()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + @ListFeature.Require(SUPPORTS_SET) + public void testSet_null() { + doTestSet(null); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = ZERO) + @ListFeature.Require(SUPPORTS_SET) + public void testSet_replacingNull() { + E[] elements = createSamplesArray(); +@@ -117,9 +117,9 @@ public class ListSetTester extends AbstractListTester { + expectUnchanged(); + } + ++ @CollectionFeature.Require(absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) + @ListFeature.Require(SUPPORTS_SET) +- @CollectionFeature.Require(absent = ALLOWS_NULL_VALUES) + public void testSet_nullUnsupported() { + try { + getList().set(aValidIndex(), null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java +index 553b693584..bef134e93c 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java +@@ -24,6 +24,7 @@ import static com.google.common.collect.testing.features.ListFeature.SUPPORTS_AD + import static com.google.common.collect.testing.features.ListFeature.SUPPORTS_REMOVE_WITH_INDEX; + import static com.google.common.collect.testing.features.ListFeature.SUPPORTS_SET; + import static java.util.Collections.emptyList; ++import static java.util.Collections.singletonList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -34,7 +35,6 @@ import com.google.common.collect.testing.features.ListFeature; + import com.google.common.testing.SerializableTester; + import java.lang.reflect.Method; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.concurrent.CopyOnWriteArrayList; + import org.junit.Ignore; +@@ -91,8 +91,8 @@ public class ListSubListTester extends AbstractListTester { + getList().subList(0, getNumElements())); + } + +- @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + public void testSubList_subListRemoveAffectsOriginal() { + List subList = getList().subList(0, 1); + subList.remove(0); +@@ -100,8 +100,8 @@ public class ListSubListTester extends AbstractListTester { + expectContents(expected); + } + +- @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) + public void testSubList_subListClearAffectsOriginal() { + List subList = getList().subList(0, 1); + subList.clear(); +@@ -116,8 +116,8 @@ public class ListSubListTester extends AbstractListTester { + expectAdded(0, e3()); + } + +- @ListFeature.Require(SUPPORTS_SET) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_SET) + public void testSubList_subListSetAffectsOriginal() { + List subList = getList().subList(0, 1); + subList.set(0, e3()); +@@ -126,20 +126,20 @@ public class ListSubListTester extends AbstractListTester { + expectContents(expected); + } + +- @ListFeature.Require(SUPPORTS_SET) + @CollectionSize.Require(absent = ZERO) ++ @ListFeature.Require(SUPPORTS_SET) + public void testSubList_originalListSetAffectsSubList() { + List subList = getList().subList(0, 1); + getList().set(0, e3()); + assertEquals( + "A set() call to a list after a sublist has been created " + + "should be reflected in the sublist", +- Collections.singletonList(e3()), ++ singletonList(e3()), + subList); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testSubList_subListRemoveAffectsOriginalLargeList() { + List subList = getList().subList(1, 3); + subList.remove(e2()); +@@ -148,16 +148,16 @@ public class ListSubListTester extends AbstractListTester { + expectContents(expected); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testSubList_subListAddAtIndexAffectsOriginalLargeList() { + List subList = getList().subList(2, 3); + subList.add(0, e3()); + expectAdded(2, e3()); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_SET) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testSubList_subListSetAffectsOriginalLargeList() { + List subList = getList().subList(1, 2); + subList.set(0, e3()); +@@ -166,8 +166,8 @@ public class ListSubListTester extends AbstractListTester { + expectContents(expected); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @ListFeature.Require(SUPPORTS_SET) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testSubList_originalListSetAffectsSubListLargeList() { + List subList = getList().subList(1, 3); + getList().set(1, e3()); +@@ -183,17 +183,17 @@ public class ListSubListTester extends AbstractListTester { + assertEquals("subList(0, 0).subList(0, 0) should be an empty list", emptyList(), subList); + } + +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testSubList_ofSubListNonEmpty() { + List subList = getList().subList(0, 2).subList(1, 2); + assertEquals( + "subList(0, 2).subList(1, 2) " + + "should be a single-element list of the element at index 1", +- Collections.singletonList(getOrderedElements().get(1)), ++ singletonList(getOrderedElements().get(1)), + subList); + } + +- @CollectionSize.Require(absent = {ZERO}) ++ @CollectionSize.Require(absent = ZERO) + public void testSubList_size() { + List list = getList(); + int size = getNumElements(); +@@ -204,7 +204,7 @@ public class ListSubListTester extends AbstractListTester { + assertEquals(0, list.subList(0, 0).size()); + } + +- @CollectionSize.Require(absent = {ZERO}) ++ @CollectionSize.Require(absent = ZERO) + public void testSubList_isEmpty() { + List list = getList(); + int size = getNumElements(); +@@ -219,7 +219,7 @@ public class ListSubListTester extends AbstractListTester { + } + } + +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testSubList_get() { + List list = getList(); + int size = getNumElements(); +@@ -243,7 +243,7 @@ public class ListSubListTester extends AbstractListTester { + } + } + +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testSubList_contains() { + List list = getList(); + int size = getNumElements(); +@@ -261,7 +261,7 @@ public class ListSubListTester extends AbstractListTester { + assertFalse(tail.contains(list.get(0))); + } + +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testSubList_indexOf() { + List list = getList(); + int size = getNumElements(); +@@ -279,7 +279,7 @@ public class ListSubListTester extends AbstractListTester { + assertEquals(-1, tail.indexOf(list.get(0))); + } + +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testSubList_lastIndexOf() { + List list = getList(); + int size = list.size(); +@@ -308,7 +308,7 @@ public class ListSubListTester extends AbstractListTester { + } + + @CollectionFeature.Require(SERIALIZABLE_INCLUDING_VIEWS) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testReserializeSubList() { + SerializableTester.reserializeAndAssert(getList().subList(0, 2)); + } +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapClearTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapClearTester.java +index 64f5127e7f..468188762d 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapClearTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapClearTester.java +@@ -48,8 +48,8 @@ public class MapClearTester extends AbstractMapTester { + assertFalse(getMap().entrySet().iterator().hasNext()); + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testClearConcurrentWithEntrySetIteration() { + try { + Iterator> iterator = getMap().entrySet().iterator(); +@@ -61,8 +61,8 @@ public class MapClearTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testClearConcurrentWithKeySetIteration() { + try { + Iterator iterator = getMap().keySet().iterator(); +@@ -74,8 +74,8 @@ public class MapClearTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testClearConcurrentWithValuesIteration() { + try { + Iterator iterator = getMap().values().iterator(); +@@ -87,8 +87,8 @@ public class MapClearTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testClear_unsupported() { + try { + getMap().clear(); +@@ -100,8 +100,8 @@ public class MapClearTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testClear_unsupportedByEmptyCollection() { + try { + getMap().clear(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java +index a6ca7be067..776ef47f99 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfAbsentTester.java +@@ -54,8 +54,8 @@ public class MapComputeIfAbsentTester extends AbstractMapTester { + expectAdded(e3()); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testComputeIfAbsent_supportedPresent() { + assertEquals( + "computeIfAbsent(present, function) should return existing value", +@@ -83,8 +83,8 @@ public class MapComputeIfAbsentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testComputeIfAbsent_nullTreatedAsAbsent() { + initMapWithNullValue(); + assertEquals( +@@ -100,7 +100,7 @@ public class MapComputeIfAbsentTester extends AbstractMapTester { + expectReplacement(entry(getKeyForNullValue(), getValueForNullKey())); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testComputeIfAbsent_nullKeySupported() { + getMap() + .computeIfAbsent( +@@ -147,8 +147,8 @@ public class MapComputeIfAbsentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testComputeIfAbsent_unsupportedPresentExistingValue() { + try { + assertEquals( +@@ -166,8 +166,8 @@ public class MapComputeIfAbsentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testComputeIfAbsent_unsupportedPresentDifferentValue() { + try { + assertEquals( +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfPresentTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfPresentTester.java +index 02e097a867..b4d1e82156 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfPresentTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeIfPresentTester.java +@@ -53,8 +53,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testComputeIfPresent_supportedPresent() { + assertEquals( + "computeIfPresent(present, function) should return new value", +@@ -70,8 +70,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectReplacement(entry(k0(), v3())); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testComputeIfPresent_functionReturnsNull() { + assertNull( + "computeIfPresent(present, returnsNull) should return null", +@@ -86,8 +86,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectMissing(e0()); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testComputeIfPresent_nullTreatedAsAbsent() { + initMapWithNullValue(); + assertNull( +@@ -103,8 +103,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + + static class ExpectedException extends RuntimeException {} + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testComputeIfPresent_functionThrows() { + try { + getMap() +@@ -121,8 +121,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testComputeIfPresent_nullKeySupportedPresent() { + initMapWithNullKey(); + assertEquals( +@@ -142,7 +142,7 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectContents(expected); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testComputeIfPresent_nullKeySupportedAbsent() { + assertNull( + "computeIfPresent(null, function) should return null", +@@ -169,8 +169,8 @@ public class MapComputeIfPresentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testComputeIfPresent_unsupportedPresent() { + try { + getMap().computeIfPresent(k0(), (k, v) -> v3()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeTester.java +index eb79e08791..ecceaf96b9 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapComputeTester.java +@@ -71,8 +71,8 @@ public class MapComputeTester extends AbstractMapTester { + assertEquals(getNumElements(), getMap().size()); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_presentToPresent() { + assertEquals( + "Map.compute(present, functionReturningValue) should return new value", +@@ -89,8 +89,8 @@ public class MapComputeTester extends AbstractMapTester { + assertEquals(getNumElements(), getMap().size()); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_presentToAbsent() { + assertNull( + "Map.compute(present, functionReturningNull) should return null", +@@ -107,8 +107,8 @@ public class MapComputeTester extends AbstractMapTester { + assertEquals(getNumElements() - 1, getMap().size()); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_presentNullToPresentNonnull() { + initMapWithNullValue(); + V value = getValueForNullKey(); +@@ -127,8 +127,8 @@ public class MapComputeTester extends AbstractMapTester { + assertEquals(getNumElements(), getMap().size()); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_presentNullToNull() { + // The spec is somewhat ambiguous about this case, but the actual default implementation + // in Map will remove a present null. +@@ -147,8 +147,8 @@ public class MapComputeTester extends AbstractMapTester { + assertEquals(getNumElements() - 1, getMap().size()); + } + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE, ALLOWS_NULL_KEYS}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_nullKeyPresentToPresent() { + initMapWithNullKey(); + assertEquals( +@@ -167,8 +167,8 @@ public class MapComputeTester extends AbstractMapTester { + + static class ExpectedException extends RuntimeException {} + +- @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE}) + public void testCompute_presentFunctionThrows() { + try { + getMap() +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java +index 3721db1174..2ac9adc331 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsKeyTester.java +@@ -55,15 +55,15 @@ public class MapContainsKeyTester extends AbstractMapTester { + expectNullKeyMissingWhenNullKeysUnsupported("containsKey(null) should return false or throw"); + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testContains_nonNullWhenNullContained() { + initMapWithNullKey(); + assertFalse("containsKey(notPresent) should return false", getMap().containsKey(k3())); + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testContains_nullContained() { + initMapWithNullKey(); + assertTrue("containsKey(null) should return true", getMap().containsKey(null)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java +index 044562ab6e..5047ed0e40 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapContainsValueTester.java +@@ -57,15 +57,15 @@ public class MapContainsValueTester extends AbstractMapTester { + "containsValue(null) should return false or throw"); + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testContains_nonNullWhenNullContained() { + initMapWithNullValue(); + assertFalse("containsValue(notPresent) should return false", getMap().containsValue(v3())); + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testContains_nullContained() { + initMapWithNullValue(); + assertTrue("containsValue(null) should return true", getMap().containsValue(null)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java +index 0810dea28a..cdf7b1edab 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapCreationTester.java +@@ -45,15 +45,15 @@ import org.junit.Ignore; + @GwtCompatible(emulated = true) + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MapCreationTester extends AbstractMapTester { +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testCreateWithNullKeySupported() { + initMapWithNullKey(); + expectContents(createArrayWithNullKey()); + } + +- @MapFeature.Require(absent = ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = ALLOWS_NULL_KEYS) + public void testCreateWithNullKeyUnsupported() { + try { + initMapWithNullKey(); +@@ -62,15 +62,15 @@ public class MapCreationTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testCreateWithNullValueSupported() { + initMapWithNullValue(); + expectContents(createArrayWithNullValue()); + } + +- @MapFeature.Require(absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = ALLOWS_NULL_VALUES) + public void testCreateWithNullValueUnsupported() { + try { + initMapWithNullValue(); +@@ -79,8 +79,8 @@ public class MapCreationTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({ALLOWS_NULL_KEYS, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, ALLOWS_NULL_VALUES}) + public void testCreateWithNullKeyAndValueSupported() { + Entry[] entries = createSamplesArray(); + entries[getNullLocation()] = entry(null, null); +@@ -88,20 +88,20 @@ public class MapCreationTester extends AbstractMapTester { + expectContents(entries); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @MapFeature.Require(value = ALLOWS_NULL_KEYS, absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testCreateWithDuplicates_nullDuplicatesNotRejected() { + expectFirstRemoved(getEntriesMultipleNullKeys()); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @MapFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testCreateWithDuplicates_nonNullDuplicatesNotRejected() { + expectFirstRemoved(getEntriesMultipleNonNullKeys()); + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @MapFeature.Require({ALLOWS_NULL_KEYS, REJECTS_DUPLICATES_AT_CREATION}) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testCreateWithDuplicates_nullDuplicatesRejected() { + Entry[] entries = getEntriesMultipleNullKeys(); + try { +@@ -111,8 +111,8 @@ public class MapCreationTester extends AbstractMapTester { + } + } + ++ @CollectionSize.Require(absent = {ONE, ZERO}) + @MapFeature.Require(REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) + public void testCreateWithDuplicates_nonNullDuplicatesRejected() { + Entry[] entries = getEntriesMultipleNonNullKeys(); + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java +index 537f091b4a..4b4387aaaf 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapEntrySetTester.java +@@ -52,8 +52,8 @@ public class MapEntrySetTester extends AbstractMapTester { + INSTANCE; + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE) ++ @CollectionSize.Require(ONE) + public void testEntrySetIteratorRemove() { + Set> entrySet = getMap().entrySet(); + Iterator> entryItr = entrySet.iterator(); +@@ -103,8 +103,8 @@ public class MapEntrySetTester extends AbstractMapTester { + assertTrue(getMap().entrySet().contains(Helpers.mapEntry(getKeyForNullValue(), null))); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testSetValue() { + for (Entry entry : getMap().entrySet()) { + if (entry.getKey().equals(k0())) { +@@ -115,8 +115,8 @@ public class MapEntrySetTester extends AbstractMapTester { + expectReplacement(entry(k0(), v3())); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testSetValueWithNullValuesPresent() { + for (Entry entry : getMap().entrySet()) { + if (entry.getKey().equals(k0())) { +@@ -127,8 +127,8 @@ public class MapEntrySetTester extends AbstractMapTester { + expectReplacement(entry(k0(), (V) null)); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testSetValueWithNullValuesAbsent() { + for (Entry entry : getMap().entrySet()) { + try { +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapForEachTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapForEachTester.java +index 40086a87ac..2ecb02eb8b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapForEachTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapForEachTester.java +@@ -57,8 +57,8 @@ public class MapForEachTester extends AbstractMapTester { + Helpers.assertEqualIgnoringOrder(getSampleEntries(), entries); + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testForEach_nullKeys() { + initMapWithNullKey(); + List> expectedEntries = Arrays.asList(createArrayWithNullKey()); +@@ -67,8 +67,8 @@ public class MapForEachTester extends AbstractMapTester { + Helpers.assertEqualIgnoringOrder(expectedEntries, entries); + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testForEach_nullValues() { + initMapWithNullValue(); + List> expectedEntries = Arrays.asList(createArrayWithNullValue()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java +index 92094a8aac..2e1326fd6e 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetOrDefaultTester.java +@@ -84,8 +84,8 @@ public class MapGetOrDefaultTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testGetOrDefault_nonNullWhenNullContained() { + initMapWithNullKey(); + assertEquals( +@@ -94,8 +94,8 @@ public class MapGetOrDefaultTester extends AbstractMapTester { + getMap().getOrDefault(k3(), v3())); + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testGetOrDefault_presentNull() { + initMapWithNullKey(); + assertEquals( +@@ -104,8 +104,8 @@ public class MapGetOrDefaultTester extends AbstractMapTester { + getMap().getOrDefault(null, v3())); + } + +- @MapFeature.Require(ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testGetOrDefault_presentMappedToNull() { + initMapWithNullValue(); + assertNull( +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java +index 89610f26c7..2f3f2754e0 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapGetTester.java +@@ -59,15 +59,15 @@ public class MapGetTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testGet_nonNullWhenNullContained() { + initMapWithNullKey(); + assertNull("get(notPresent) should return null", get(k3())); + } + +- @MapFeature.Require(ALLOWS_NULL_KEYS) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testGet_nullContained() { + initMapWithNullKey(); + assertEquals("get(null) should return the associated value", getValueForNullKey(), get(null)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapMergeTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapMergeTester.java +index c001afa009..da65752af8 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapMergeTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapMergeTester.java +@@ -58,8 +58,8 @@ public class MapMergeTester extends AbstractMapTester { + expectAdded(e3()); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testMappedToNull() { + initMapWithNullValue(); + assertEquals( +@@ -76,7 +76,7 @@ public class MapMergeTester extends AbstractMapTester { + expectReplacement(entry(getKeyForNullValue(), v3())); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testMergeAbsentNullKey() { + assertEquals( + "Map.merge(null, value, function) should return value", +@@ -92,8 +92,8 @@ public class MapMergeTester extends AbstractMapTester { + expectAdded(entry(null, v3())); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testMergePresent() { + assertEquals( + "Map.merge(present, value, function) should return function result", +@@ -112,8 +112,8 @@ public class MapMergeTester extends AbstractMapTester { + + private static class ExpectedException extends RuntimeException {} + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testMergeFunctionThrows() { + try { + getMap() +@@ -131,8 +131,8 @@ public class MapMergeTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testMergePresentToNull() { + assertNull( + "Map.merge(present, value, functionReturningNull) should return null", +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java +index 21d89d8d68..28af9176cd 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutAllTester.java +@@ -93,15 +93,15 @@ public class MapPutAllTester extends AbstractMapTester { + expectMissing(e3(), e4()); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testPutAll_supportedSomePresent() { + putAll(MinimalCollection.of(e3(), e0())); + expectAdded(e3()); + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + public void testPutAllSomePresentConcurrentWithEntrySetIteration() { + try { + Iterator> iterator = getMap().entrySet().iterator(); +@@ -113,8 +113,8 @@ public class MapPutAllTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPutAll_unsupportedSomePresent() { + try { + putAll(MinimalCollection.of(e3(), e0())); +@@ -124,8 +124,8 @@ public class MapPutAllTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPutAll_unsupportedAllPresent() { + try { + putAll(MinimalCollection.of(e0())); +@@ -134,7 +134,7 @@ public class MapPutAllTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testPutAll_nullKeySupported() { + putAll(containsNullKey); + expectAdded(containsNullKey.get(0)); +@@ -152,7 +152,7 @@ public class MapPutAllTester extends AbstractMapTester { + "Should not contain null key after unsupported putAll(containsNullKey)"); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPutAll_nullValueSupported() { + putAll(containsNullValue); + expectAdded(containsNullValue.get(0)); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java +index c9aa930eb0..9956e3dee9 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java +@@ -45,8 +45,8 @@ public class MapPutIfAbsentTester extends AbstractMapTester { + expectAdded(e3()); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testPutIfAbsent_supportedPresent() { + assertEquals( + "putIfAbsent(present, value) should return existing value", +@@ -66,8 +66,8 @@ public class MapPutIfAbsentTester extends AbstractMapTester { + expectMissing(e3()); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPutIfAbsent_unsupportedPresentExistingValue() { + try { + assertEquals( +@@ -79,8 +79,8 @@ public class MapPutIfAbsentTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPutIfAbsent_unsupportedPresentDifferentValue() { + try { + getMap().putIfAbsent(k0(), v3()); +@@ -113,8 +113,8 @@ public class MapPutIfAbsentTester extends AbstractMapTester { + "Should not contain null value after unsupported put(key, null)"); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testPutIfAbsent_putWithNullValueUnsupported() { + try { + getMap().putIfAbsent(k0(), null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java +index c9a745d4ad..1491b79b4b 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java +@@ -59,8 +59,8 @@ public class MapPutTester extends AbstractMapTester { + presentKeyNullValueEntry = entry(k0(), null); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testPut_supportedPresent() { + assertEquals("put(present, value) should return the old value", v0(), getMap().put(k0(), v3())); + expectReplacement(entry(k0(), v3())); +@@ -72,8 +72,8 @@ public class MapPutTester extends AbstractMapTester { + expectAdded(e3()); + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + public void testPutAbsentConcurrentWithEntrySetIteration() { + try { + Iterator> iterator = getMap().entrySet().iterator(); +@@ -85,8 +85,8 @@ public class MapPutTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + public void testPutAbsentConcurrentWithKeySetIteration() { + try { + Iterator iterator = getMap().keySet().iterator(); +@@ -98,8 +98,8 @@ public class MapPutTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT}) + public void testPutAbsentConcurrentWithValueIteration() { + try { + Iterator iterator = getMap().values().iterator(); +@@ -122,8 +122,8 @@ public class MapPutTester extends AbstractMapTester { + expectMissing(e3()); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPut_unsupportedPresentExistingValue() { + try { + assertEquals("put(present, existingValue) should return present or throw", v0(), put(e0())); +@@ -132,8 +132,8 @@ public class MapPutTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testPut_unsupportedPresentDifferentValue() { + try { + getMap().put(k0(), v3()); +@@ -143,14 +143,14 @@ public class MapPutTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testPut_nullKeySupportedNotPresent() { + assertNull("put(null, value) should return null", put(nullKeyEntry)); + expectAdded(nullKeyEntry); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_PUT}) + public void testPut_nullKeySupportedPresent() { + Entry newEntry = entry(null, v3()); + initMapWithNullKey(); +@@ -176,7 +176,7 @@ public class MapPutTester extends AbstractMapTester { + "Should not contain null key after unsupported put(null, value)"); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPut_nullValueSupported() { + assertNull("put(key, null) should return null", put(nullValueEntry)); + expectAdded(nullValueEntry); +@@ -194,8 +194,8 @@ public class MapPutTester extends AbstractMapTester { + "Should not contain null value after unsupported put(key, null)"); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPut_replaceWithNullValueSupported() { + assertEquals( + "put(present, null) should return the associated value", +@@ -204,8 +204,8 @@ public class MapPutTester extends AbstractMapTester { + expectReplacement(presentKeyNullValueEntry); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testPut_replaceWithNullValueUnsupported() { + try { + put(presentKeyNullValueEntry); +@@ -217,8 +217,8 @@ public class MapPutTester extends AbstractMapTester { + "Should not contain null after unsupported put(present, null)"); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPut_replaceNullValueWithNullSupported() { + initMapWithNullValue(); + assertNull( +@@ -227,8 +227,8 @@ public class MapPutTester extends AbstractMapTester { + expectContents(createArrayWithNullValue()); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUES}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPut_replaceNullValueWithNonNullSupported() { + Entry newEntry = entry(getKeyForNullValue(), v3()); + initMapWithNullValue(); +@@ -239,7 +239,7 @@ public class MapPutTester extends AbstractMapTester { + expectContents(expected); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_KEYS, ALLOWS_NULL_VALUES}) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, ALLOWS_NULL_VALUES, SUPPORTS_PUT}) + public void testPut_nullKeyAndValueSupported() { + assertNull("put(null, null) should return null", put(nullKeyValueEntry)); + expectAdded(nullKeyValueEntry); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveEntryTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveEntryTester.java +index a59a74a101..2638a20c13 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveEntryTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveEntryTester.java +@@ -37,8 +37,8 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MapRemoveEntryTester extends AbstractMapTester { +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testRemove_supportedPresent() { + assertTrue(getMap().remove(k0(), v0())); + expectMissing(e0()); +@@ -82,8 +82,8 @@ public class MapRemoveEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testRemove_unsupportedPresent() { + try { + getMap().remove(k0(), v0()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java +index 00c074e5e8..94409fb05f 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java +@@ -44,8 +44,8 @@ import org.junit.Ignore; + @GwtCompatible + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MapRemoveTester extends AbstractMapTester { +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testRemove_present() { + int initialSize = getMap().size(); + assertEquals("remove(present) should return the associated value", v0(), getMap().remove(k0())); +@@ -54,8 +54,8 @@ public class MapRemoveTester extends AbstractMapTester { + expectMissing(e0()); + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testRemovePresentConcurrentWithEntrySetIteration() { + try { + Iterator> iterator = getMap().entrySet().iterator(); +@@ -67,8 +67,8 @@ public class MapRemoveTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testRemovePresentConcurrentWithKeySetIteration() { + try { + Iterator iterator = getMap().keySet().iterator(); +@@ -80,8 +80,8 @@ public class MapRemoveTester extends AbstractMapTester { + } + } + +- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_REMOVE}) + public void testRemovePresentConcurrentWithValuesIteration() { + try { + Iterator iterator = getMap().values().iterator(); +@@ -99,8 +99,8 @@ public class MapRemoveTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_KEYS}) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require({ALLOWS_NULL_KEYS, SUPPORTS_REMOVE}) + public void testRemove_nullPresent() { + initMapWithNullKey(); + +@@ -114,8 +114,8 @@ public class MapRemoveTester extends AbstractMapTester { + expectMissing(entry(null, getValueForNullKey())); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testRemove_unsupported() { + try { + getMap().remove(k0()); +@@ -148,7 +148,7 @@ public class MapRemoveTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_REMOVE, ALLOWS_NULL_KEY_QUERIES}) ++ @MapFeature.Require({ALLOWS_NULL_KEY_QUERIES, SUPPORTS_REMOVE}) + public void testRemove_nullSupportedMissing() { + assertNull("remove(null) should return null", getMap().remove(null)); + expectUnchanged(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceAllTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceAllTester.java +index eb37a60135..8283698f15 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceAllTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceAllTester.java +@@ -65,8 +65,8 @@ public class MapReplaceAllTester extends AbstractMapTester { + expectContents(expectedEntries); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionFeature.Require(KNOWN_ORDER) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceAllPreservesOrder() { + getMap() + .replaceAll( +@@ -82,8 +82,8 @@ public class MapReplaceAllTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplaceAll_unsupported() { + try { + getMap() +@@ -100,8 +100,8 @@ public class MapReplaceAllTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplaceAll_unsupportedByEmptyCollection() { + try { + getMap() +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java +index 8a619da4db..4613fbe509 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceEntryTester.java +@@ -38,8 +38,8 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MapReplaceEntryTester extends AbstractMapTester { + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedPresent() { + try { + assertTrue(getMap().replace(k0(), v0(), v3())); +@@ -49,15 +49,15 @@ public class MapReplaceEntryTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedPresentUnchanged() { + assertTrue(getMap().replace(k0(), v0(), v0())); + expectUnchanged(); + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplaceEntry_supportedWrongValue() { + assertFalse(getMap().replace(k0(), v3(), v4())); + expectUnchanged(); +@@ -69,8 +69,8 @@ public class MapReplaceEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testReplaceEntry_presentNullValueUnsupported() { + try { + getMap().replace(k0(), v0(), null); +@@ -80,8 +80,8 @@ public class MapReplaceEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUE_QUERIES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUE_QUERIES) + public void testReplaceEntry_wrongValueNullValueUnsupported() { + try { + assertFalse(getMap().replace(k0(), v3(), null)); +@@ -101,7 +101,7 @@ public class MapReplaceEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require({SUPPORTS_PUT, ALLOWS_NULL_VALUE_QUERIES}) ++ @MapFeature.Require({ALLOWS_NULL_VALUE_QUERIES, SUPPORTS_PUT}) + public void testReplaceEntry_nullDifferentFromAbsent() { + assertFalse(getMap().replace(k3(), null, v3())); + expectUnchanged(); +@@ -117,8 +117,8 @@ public class MapReplaceEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplaceEntry_unsupportedPresent() { + try { + getMap().replace(k0(), v0(), v3()); +@@ -128,8 +128,8 @@ public class MapReplaceEntryTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplaceEntry_unsupportedWrongValue() { + try { + getMap().replace(k0(), v3(), v4()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceTester.java +index b4101f2671..abb961fe82 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceTester.java +@@ -39,8 +39,8 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class MapReplaceTester extends AbstractMapTester { + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplace_supportedPresent() { + try { + assertEquals(v0(), getMap().replace(k0(), v3())); +@@ -50,8 +50,8 @@ public class MapReplaceTester extends AbstractMapTester { + } + } + +- @MapFeature.Require(SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(SUPPORTS_PUT) + public void testReplace_supportedPresentNoChange() { + assertEquals(v0(), getMap().replace(k0(), v0())); + expectUnchanged(); +@@ -63,8 +63,8 @@ public class MapReplaceTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(value = SUPPORTS_PUT, absent = ALLOWS_NULL_VALUES) + public void testReplace_presentNullValueUnsupported() { + try { + getMap().replace(k0(), null); +@@ -94,8 +94,8 @@ public class MapReplaceTester extends AbstractMapTester { + expectUnchanged(); + } + +- @MapFeature.Require(absent = SUPPORTS_PUT) + @CollectionSize.Require(absent = ZERO) ++ @MapFeature.Require(absent = SUPPORTS_PUT) + public void testReplace_unsupportedPresent() { + try { + getMap().replace(k0(), v3()); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapToStringTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapToStringTester.java +index 429f8f4957..5ba3245f13 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapToStringTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapToStringTester.java +@@ -45,28 +45,28 @@ public class MapToStringTester extends AbstractMapTester { + assertNotNull("toString() should not return null", getMap().toString()); + } + +- @CollectionSize.Require(ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ZERO) + public void testToString_size0() { + assertEquals("emptyMap.toString should return {}", "{}", getMap().toString()); + } + +- @CollectionSize.Require(ONE) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(ONE) + public void testToString_size1() { + assertEquals("size1Map.toString should return {entry}", "{" + e0() + "}", getMap().toString()); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(absent = ZERO) + @MapFeature.Require(ALLOWS_NULL_KEYS) + public void testToStringWithNullKey() { + initMapWithNullKey(); + testToString_formatting(); + } + +- @CollectionSize.Require(absent = ZERO) + @CollectionFeature.Require(absent = NON_STANDARD_TOSTRING) ++ @CollectionSize.Require(absent = ZERO) + @MapFeature.Require(ALLOWS_NULL_VALUES) + public void testToStringWithNullValue() { + initMapWithNullValue(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java +index ebb86b6156..0ba6be597c 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableMapNavigationTester.java +@@ -20,6 +20,7 @@ import static com.google.common.collect.testing.features.CollectionSize.ONE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; + import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE; ++import static java.util.Collections.reverse; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.AbstractMapTester; +@@ -83,8 +84,8 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertNull(navigableMap.firstEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testEmptyMapPollFirst() { + assertNull(navigableMap.pollFirstEntry()); + } +@@ -106,8 +107,8 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertNull(navigableMap.lastEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(ZERO) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testEmptyMapPollLast() { + assertNull(navigableMap.pollLastEntry()); + } +@@ -117,8 +118,8 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertEquals(a, navigableMap.firstEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(ONE) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testSingletonMapPollFirst() { + assertEquals(a, navigableMap.pollFirstEntry()); + assertTrue(navigableMap.isEmpty()); +@@ -141,8 +142,8 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertEquals(a, navigableMap.lastEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(ONE) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testSingletonMapPollLast() { + assertEquals(a, navigableMap.pollLastEntry()); + assertTrue(navigableMap.isEmpty()); +@@ -153,8 +154,8 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertEquals(a, navigableMap.firstEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testPollFirst() { + assertEquals(a, navigableMap.pollFirstEntry()); + assertEquals(entries.subList(1, entries.size()), Helpers.copyToList(navigableMap.entrySet())); +@@ -218,16 +219,16 @@ public class NavigableMapNavigationTester extends AbstractMapTester + assertEquals(c, navigableMap.lastEntry()); + } + +- @MapFeature.Require(SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(SUPPORTS_REMOVE) + public void testPollLast() { + assertEquals(c, navigableMap.pollLastEntry()); + assertEquals( + entries.subList(0, entries.size() - 1), Helpers.copyToList(navigableMap.entrySet())); + } + +- @MapFeature.Require(absent = SUPPORTS_REMOVE) + @CollectionSize.Require(SEVERAL) ++ @MapFeature.Require(absent = SUPPORTS_REMOVE) + public void testPollLastUnsupported() { + try { + navigableMap.pollLastEntry(); +@@ -239,7 +240,7 @@ public class NavigableMapNavigationTester extends AbstractMapTester + @CollectionSize.Require(SEVERAL) + public void testDescendingNavigation() { + List> descending = new ArrayList<>(navigableMap.descendingMap().entrySet()); +- Collections.reverse(descending); ++ reverse(descending); + assertEquals(entries, descending); + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java +index 8b056b4cb1..a0c08fb057 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java +@@ -20,6 +20,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.SUPPO + import static com.google.common.collect.testing.features.CollectionSize.ONE; + import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; + import static com.google.common.collect.testing.features.CollectionSize.ZERO; ++import static java.util.Collections.reverse; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.collect.testing.Helpers; +@@ -222,7 +223,7 @@ public class NavigableSetNavigationTester extends AbstractSetTester { + for (Iterator i = navigableSet.descendingIterator(); i.hasNext(); ) { + descending.add(i.next()); + } +- Collections.reverse(descending); ++ reverse(descending); + assertEquals(values, descending); + } + +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/QueueOfferTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/QueueOfferTester.java +index 3b17289538..cfbd0f9d05 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/QueueOfferTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/QueueOfferTester.java +@@ -39,7 +39,7 @@ public class QueueOfferTester extends AbstractQueueTester { + expectAdded(e3()); + } + +- @CollectionFeature.Require({SUPPORTS_ADD, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_ADD}) + public void testOffer_nullSupported() { + assertTrue("offer(null) should return true", getQueue().offer(null)); + expectAdded((E) null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/SetAddTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/SetAddTester.java +index 197496827e..f3905924df 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/SetAddTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/SetAddTester.java +@@ -44,7 +44,7 @@ public class SetAddTester extends AbstractSetTester { + expectUnchanged(); + } + +- @CollectionFeature.Require(value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES}) ++ @CollectionFeature.Require({ALLOWS_NULL_VALUES, SUPPORTS_ADD}) + @CollectionSize.Require(absent = ZERO) + public void testAdd_supportedNullPresent() { + E[] array = createArrayWithNullElement(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/SetCreationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/SetCreationTester.java +index 0c1be6b7ab..c9d29a7643 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/SetCreationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/SetCreationTester.java +@@ -39,7 +39,7 @@ import org.junit.Ignore; + @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. + public class SetCreationTester extends AbstractSetTester { + @CollectionFeature.Require(value = ALLOWS_NULL_VALUES, absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testCreateWithDuplicates_nullDuplicatesNotRejected() { + E[] array = createArrayWithNullElement(); + array[0] = null; +@@ -50,7 +50,7 @@ public class SetCreationTester extends AbstractSetTester { + } + + @CollectionFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testCreateWithDuplicates_nonNullDuplicatesNotRejected() { + E[] array = createSamplesArray(); + array[1] = e0(); +@@ -61,7 +61,7 @@ public class SetCreationTester extends AbstractSetTester { + } + + @CollectionFeature.Require({ALLOWS_NULL_VALUES, REJECTS_DUPLICATES_AT_CREATION}) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testCreateWithDuplicates_nullDuplicatesRejected() { + E[] array = createArrayWithNullElement(); + array[0] = null; +@@ -73,7 +73,7 @@ public class SetCreationTester extends AbstractSetTester { + } + + @CollectionFeature.Require(REJECTS_DUPLICATES_AT_CREATION) +- @CollectionSize.Require(absent = {ZERO, ONE}) ++ @CollectionSize.Require(absent = {ONE, ZERO}) + public void testCreateWithDuplicates_nonNullDuplicatesRejected() { + E[] array = createSamplesArray(); + array[1] = e0(); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/SetEqualsTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/SetEqualsTester.java +index 839e1737c7..7af49d5243 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/SetEqualsTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/SetEqualsTester.java +@@ -51,8 +51,8 @@ public class SetEqualsTester extends AbstractSetTester { + getSet().equals(MinimalSet.from(elements))); + } + +- @CollectionSize.Require(absent = CollectionSize.ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = CollectionSize.ZERO) + public void testEquals_containingNull() { + Collection elements = getSampleElements(getNumElements() - 1); + elements.add(null); +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java +index 5f60327d47..175bda03f5 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java +@@ -46,8 +46,8 @@ public class SetHashCodeTester extends AbstractSetTester { + getSet().hashCode()); + } + +- @CollectionSize.Require(absent = CollectionSize.ZERO) + @CollectionFeature.Require(ALLOWS_NULL_VALUES) ++ @CollectionSize.Require(absent = CollectionSize.ZERO) + public void testHashCode_containingNull() { + Collection elements = getSampleElements(getNumElements() - 1); + int expectedHashCode = 0; +diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/SortedMapNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/SortedMapNavigationTester.java +index 691fee139b..fda38a3fa0 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/testers/SortedMapNavigationTester.java ++++ b/guava-testlib/src/com/google/common/collect/testing/testers/SortedMapNavigationTester.java +@@ -172,8 +172,8 @@ public class SortedMapNavigationTester extends AbstractMapTester { + if (comparator == null) { + comparator = + new Comparator() { +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public int compare(K o1, K o2) { + return ((Comparable) o1).compareTo(o2); + } +diff --git a/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java b/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java +index 1325d7f8c0..ed1628a486 100644 +--- a/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java ++++ b/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java +@@ -17,6 +17,8 @@ + package com.google.common.testing; + + import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Predicates.alwaysTrue; ++import static java.util.UUID.randomUUID; + + import com.google.common.annotations.GwtIncompatible; + import com.google.common.base.CharMatcher; +@@ -25,7 +27,6 @@ import com.google.common.base.Defaults; + import com.google.common.base.Equivalence; + import com.google.common.base.Joiner; + import com.google.common.base.Predicate; +-import com.google.common.base.Predicates; + import com.google.common.base.Splitter; + import com.google.common.base.Stopwatch; + import com.google.common.base.Ticker; +@@ -214,13 +215,13 @@ public final class ArbitraryInstances { + .put(OptionalInt.class, OptionalInt.empty()) + .put(OptionalLong.class, OptionalLong.empty()) + .put(OptionalDouble.class, OptionalDouble.empty()) +- .put(UUID.class, UUID.randomUUID()) ++ .put(UUID.class, randomUUID()) + // common.base + .put(CharMatcher.class, CharMatcher.none()) + .put(Joiner.class, Joiner.on(',')) + .put(Splitter.class, Splitter.on(',')) + .put(com.google.common.base.Optional.class, com.google.common.base.Optional.absent()) +- .put(Predicate.class, Predicates.alwaysTrue()) ++ .put(Predicate.class, alwaysTrue()) + .put(Equivalence.class, Equivalence.equals()) + .put(Ticker.class, Ticker.systemTicker()) + .put(Stopwatch.class, Stopwatch.createUnstarted()) +diff --git a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +index 0c8daf08e1..5902f87932 100644 +--- a/guava-testlib/src/com/google/common/testing/ClassSanityTester.java ++++ b/guava-testlib/src/com/google/common/testing/ClassSanityTester.java +@@ -647,7 +647,7 @@ public final class ClassSanityTester { + + // distinctValues is a type-safe class-values mapping, but we don't have a type-safe data + // structure to hold the mappings. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + private FreshValueGenerator newFreshValueGenerator() { + FreshValueGenerator generator = + new FreshValueGenerator() { +diff --git a/guava-testlib/src/com/google/common/testing/ClusterException.java b/guava-testlib/src/com/google/common/testing/ClusterException.java +index 688ffa5ab2..c7c0b0a418 100644 +--- a/guava-testlib/src/com/google/common/testing/ClusterException.java ++++ b/guava-testlib/src/com/google/common/testing/ClusterException.java +@@ -16,11 +16,12 @@ + + package com.google.common.testing; + ++import static java.util.Collections.unmodifiableCollection; ++ + import com.google.common.annotations.GwtCompatible; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + + /** + * An {@link ClusterException} is a data structure that allows for some code to "throw multiple +@@ -68,7 +69,7 @@ final class ClusterException extends RuntimeException { + exceptions.size() + " exceptions were thrown. The first exception is listed as a cause.", + exceptions.iterator().next()); + ArrayList temp = new ArrayList<>(exceptions); +- this.exceptions = Collections.unmodifiableCollection(temp); ++ this.exceptions = unmodifiableCollection(temp); + } + + /** +diff --git a/guava-testlib/src/com/google/common/testing/CollectorTester.java b/guava-testlib/src/com/google/common/testing/CollectorTester.java +index ab6e544d8a..ffe0b13b64 100644 +--- a/guava-testlib/src/com/google/common/testing/CollectorTester.java ++++ b/guava-testlib/src/com/google/common/testing/CollectorTester.java +@@ -17,12 +17,12 @@ + package com.google.common.testing; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.reverse; + import static junit.framework.Assert.assertTrue; + + import com.google.common.annotations.GwtCompatible; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.EnumSet; + import java.util.List; + import java.util.Objects; +@@ -142,7 +142,7 @@ public final class CollectorTester { + List list = Arrays.asList(inputs); + doExpectCollects(expectedResult, list); + if (collector.characteristics().contains(Collector.Characteristics.UNORDERED)) { +- Collections.reverse(list); ++ reverse(list); + doExpectCollects(expectedResult, list); + } + return this; +diff --git a/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java b/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java +index bb51e408b2..f88aefa81a 100644 +--- a/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java ++++ b/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java +@@ -943,15 +943,15 @@ class FreshValueGenerator { + return table; + } + +- @SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such +- @Generates ++ @Generates // TreeBasedTable.create() is defined as such ++ @SuppressWarnings("rawtypes") + static + RowSortedTable generateRowSortedTable(R row, C column, V value) { + return generateTreeBasedTable(row, column, value); + } + +- @SuppressWarnings("rawtypes") // TreeBasedTable.create() is defined as such +- @Generates ++ @Generates // TreeBasedTable.create() is defined as such ++ @SuppressWarnings("rawtypes") + static + TreeBasedTable generateTreeBasedTable(R row, C column, V value) { + TreeBasedTable table = TreeBasedTable.create(); +diff --git a/guava-testlib/src/com/google/common/testing/TestLogHandler.java b/guava-testlib/src/com/google/common/testing/TestLogHandler.java +index 41dca2ec8b..68a61861d1 100644 +--- a/guava-testlib/src/com/google/common/testing/TestLogHandler.java ++++ b/guava-testlib/src/com/google/common/testing/TestLogHandler.java +@@ -16,9 +16,10 @@ + + package com.google.common.testing; + ++import static java.util.Collections.unmodifiableList; ++ + import com.google.common.annotations.GwtCompatible; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.logging.Handler; + import java.util.logging.LogRecord; +@@ -82,6 +83,6 @@ public class TestLogHandler extends Handler { + */ + public synchronized List getStoredLogRecords() { + List result = new ArrayList<>(list); +- return Collections.unmodifiableList(result); ++ return unmodifiableList(result); + } + } +diff --git a/guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java b/guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java +index b5bec2c094..08ca9c83b1 100644 +--- a/guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java ++++ b/guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java +@@ -204,7 +204,7 @@ public abstract class AbstractListenableFutureTest extends TestCase { + + // Right in the middle start up a thread to close the latch. + if (i == 10) { +- new Thread(() -> latch.countDown()).start(); ++ new Thread(latch::countDown).start(); + } + + future.addListener(listenerLatch::countDown, exec); +diff --git a/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java b/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java +index 25b7ef791c..bf08296ab3 100644 +--- a/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java ++++ b/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java +@@ -16,10 +16,10 @@ + + package com.google.common.util.concurrent.testing; + ++import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService; + + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture; + import com.google.common.util.concurrent.ListenableFuture; + import com.google.common.util.concurrent.ListenableScheduledFuture; +@@ -71,33 +71,33 @@ class SameThreadScheduledExecutorService extends AbstractExecutorService + + @Override + public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + return delegate.awaitTermination(timeout, unit); + } + + @Override + public ListenableFuture submit(Callable task) { +- Preconditions.checkNotNull(task, "task must not be null!"); ++ checkNotNull(task, "task must not be null!"); + return delegate.submit(task); + } + + @Override + public ListenableFuture submit(Runnable task, T result) { +- Preconditions.checkNotNull(task, "task must not be null!"); +- Preconditions.checkNotNull(result, "result must not be null!"); ++ checkNotNull(task, "task must not be null!"); ++ checkNotNull(result, "result must not be null!"); + return delegate.submit(task, result); + } + + @Override + public ListenableFuture submit(Runnable task) { +- Preconditions.checkNotNull(task, "task must not be null!"); ++ checkNotNull(task, "task must not be null!"); + return delegate.submit(task); + } + + @Override + public List> invokeAll(Collection> tasks) + throws InterruptedException { +- Preconditions.checkNotNull(tasks, "tasks must not be null!"); ++ checkNotNull(tasks, "tasks must not be null!"); + return delegate.invokeAll(tasks); + } + +@@ -105,44 +105,44 @@ class SameThreadScheduledExecutorService extends AbstractExecutorService + public List> invokeAll( + Collection> tasks, long timeout, TimeUnit unit) + throws InterruptedException { +- Preconditions.checkNotNull(tasks, "tasks must not be null!"); +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(tasks, "tasks must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + return delegate.invokeAll(tasks, timeout, unit); + } + + @Override + public T invokeAny(Collection> tasks) + throws InterruptedException, ExecutionException { +- Preconditions.checkNotNull(tasks, "tasks must not be null!"); ++ checkNotNull(tasks, "tasks must not be null!"); + return delegate.invokeAny(tasks); + } + + @Override + public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException { +- Preconditions.checkNotNull(tasks, "tasks must not be null!"); +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(tasks, "tasks must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + return delegate.invokeAny(tasks, timeout, unit); + } + + @Override + public void execute(Runnable command) { +- Preconditions.checkNotNull(command, "command must not be null!"); ++ checkNotNull(command, "command must not be null!"); + delegate.execute(command); + } + + @Override + public ListenableScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { +- Preconditions.checkNotNull(command, "command must not be null"); +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(command, "command must not be null"); ++ checkNotNull(unit, "unit must not be null!"); + return schedule(java.util.concurrent.Executors.callable(command), delay, unit); + } + + @Override + public ListenableScheduledFuture schedule( + Callable callable, long delay, TimeUnit unit) { +- Preconditions.checkNotNull(callable, "callable must not be null!"); +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(callable, "callable must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + ListenableFuture delegateFuture = submit(callable); + return new ImmediateScheduledFuture<>(delegateFuture); + } +@@ -158,19 +158,19 @@ class SameThreadScheduledExecutorService extends AbstractExecutorService + @Override + public V get(long timeout, TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException { +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + return get(); + } + + @Override + public long getDelay(TimeUnit unit) { +- Preconditions.checkNotNull(unit, "unit must not be null!"); ++ checkNotNull(unit, "unit must not be null!"); + return 0; + } + + @Override + public int compareTo(Delayed other) { +- Preconditions.checkNotNull(other, "other must not be null!"); ++ checkNotNull(other, "other must not be null!"); + return 0; + } + } +diff --git a/guava/src/com/google/common/base/Absent.java b/guava/src/com/google/common/base/Absent.java +index f96136b5ef..e028ef0eb2 100644 +--- a/guava/src/com/google/common/base/Absent.java ++++ b/guava/src/com/google/common/base/Absent.java +@@ -15,9 +15,9 @@ + package com.google.common.base; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.emptySet; + + import com.google.common.annotations.GwtCompatible; +-import java.util.Collections; + import java.util.Set; + import javax.annotation.CheckForNull; + +@@ -49,8 +49,8 @@ final class Absent extends Optional { + return checkNotNull(defaultValue, "use Optional.orNull() instead of Optional.or(null)"); + } + +- @SuppressWarnings("unchecked") // safe covariant cast +- @Override ++ @Override // safe covariant cast ++ @SuppressWarnings("unchecked") + public Optional or(Optional secondChoice) { + return (Optional) checkNotNull(secondChoice); + } +@@ -61,15 +61,15 @@ final class Absent extends Optional { + supplier.get(), "use Optional.orNull() instead of a Supplier that returns null"); + } + +- @Override + @CheckForNull ++ @Override + public T orNull() { + return null; + } + + @Override + public Set asSet() { +- return Collections.emptySet(); ++ return emptySet(); + } + + @Override +diff --git a/guava/src/com/google/common/base/CharMatcher.java b/guava/src/com/google/common/base/CharMatcher.java +index 253bc6a22f..1cc8026aad 100644 +--- a/guava/src/com/google/common/base/CharMatcher.java ++++ b/guava/src/com/google/common/base/CharMatcher.java +@@ -1739,8 +1739,8 @@ public abstract class CharMatcher implements Predicate { + return Arrays.binarySearch(chars, c) >= 0; + } + +- @Override +- @GwtIncompatible // used only from other GwtIncompatible code ++ @GwtIncompatible ++ @Override // used only from other GwtIncompatible code + void setBits(BitSet table) { + for (char c : chars) { + table.set(c); +@@ -1805,8 +1805,8 @@ public abstract class CharMatcher implements Predicate { + return predicate.apply(c); + } + +- @SuppressWarnings("deprecation") // intentional; deprecation is for callers primarily +- @Override ++ @Override // intentional; deprecation is for callers primarily ++ @SuppressWarnings("deprecation") + public boolean apply(Character character) { + return predicate.apply(checkNotNull(character)); + } +diff --git a/guava/src/com/google/common/base/Converter.java b/guava/src/com/google/common/base/Converter.java +index 422480d164..f1ea113513 100644 +--- a/guava/src/com/google/common/base/Converter.java ++++ b/guava/src/com/google/common/base/Converter.java +@@ -285,9 +285,9 @@ public abstract class Converter implements Function { + return fromIterator.hasNext(); + } + +- @Override +- @SuppressWarnings("nullness") // See code comments on convertAll and Converter.apply. + @CheckForNull ++ @Override // See code comments on convertAll and Converter.apply. ++ @SuppressWarnings("nullness") + public B next() { + return convert(fromIterator.next()); + } +@@ -340,14 +340,14 @@ public abstract class Converter implements Function { + throw new AssertionError(); + } + +- @Override + @CheckForNull ++ @Override + A correctedDoForward(@CheckForNull B b) { + return original.correctedDoBackward(b); + } + +- @Override + @CheckForNull ++ @Override + B correctedDoBackward(@CheckForNull A a) { + return original.correctedDoForward(a); + } +@@ -422,14 +422,14 @@ public abstract class Converter implements Function { + throw new AssertionError(); + } + +- @Override + @CheckForNull ++ @Override + C correctedDoForward(@CheckForNull A a) { + return second.correctedDoForward(first.correctedDoForward(a)); + } + +- @Override + @CheckForNull ++ @Override + A correctedDoBackward(@CheckForNull C c) { + return first.correctedDoBackward(second.correctedDoBackward(c)); + } +@@ -459,9 +459,9 @@ public abstract class Converter implements Function { + /** + * @deprecated Provided to satisfy the {@code Function} interface; use {@link #convert} instead. + */ +- @Deprecated +- @Override + @CanIgnoreReturnValue ++ @CheckForNull ++ @Deprecated + /* + * Even though we implement `Function` instead of `Function<@Nullable A, @Nullable B>` (as + * discussed in a code comment at the top of the class), we declare our override of Function.apply +@@ -492,9 +492,9 @@ public abstract class Converter implements Function { + * various hypothetical futures. (Plus, a tool that were that smart would likely already introduce + * problems with LegacyConverter.) + */ +- @SuppressWarnings("nullness") +- @CheckForNull + @InlineMe(replacement = "this.convert(a)") ++ @Override ++ @SuppressWarnings("nullness") + public final B apply(@CheckForNull A a) { + return convert(a); + } +diff --git a/guava/src/com/google/common/base/Defaults.java b/guava/src/com/google/common/base/Defaults.java +index 5d12343ed2..1737c88168 100644 +--- a/guava/src/com/google/common/base/Defaults.java ++++ b/guava/src/com/google/common/base/Defaults.java +@@ -38,8 +38,8 @@ public final class Defaults { + * false} for {@code boolean} and {@code '\0'} for {@code char}. For non-primitive types and + * {@code void}, {@code null} is returned. + */ +- @SuppressWarnings("unchecked") + @CheckForNull ++ @SuppressWarnings("unchecked") + public static T defaultValue(Class type) { + checkNotNull(type); + if (type.isPrimitive()) { +diff --git a/guava/src/com/google/common/base/FinalizableReferenceQueue.java b/guava/src/com/google/common/base/FinalizableReferenceQueue.java +index 7447b8051d..70dfac8ed2 100644 +--- a/guava/src/com/google/common/base/FinalizableReferenceQueue.java ++++ b/guava/src/com/google/common/base/FinalizableReferenceQueue.java +@@ -242,8 +242,8 @@ public class FinalizableReferenceQueue implements Closeable { + // finding Finalizer on the system class path even if it is there. + @VisibleForTesting static boolean disabled; + +- @Override + @CheckForNull ++ @Override + public Class loadFinalizer() { + if (disabled) { + return null; +@@ -280,8 +280,8 @@ public class FinalizableReferenceQueue implements Closeable { + + "loader. To support reclaiming this class loader, either resolve the underlying " + + "issue, or move Guava to your system class path."; + +- @Override + @CheckForNull ++ @Override + public Class loadFinalizer() { + try { + /* +diff --git a/guava/src/com/google/common/base/Function.java b/guava/src/com/google/common/base/Function.java +index 45287b744a..0844cf5360 100644 +--- a/guava/src/com/google/common/base/Function.java ++++ b/guava/src/com/google/common/base/Function.java +@@ -45,8 +45,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; + @ElementTypesAreNonnullByDefault + public interface Function + extends java.util.function.Function { +- @Override +- @CanIgnoreReturnValue // TODO(kevinb): remove this ++ @CanIgnoreReturnValue ++ @Override // TODO(kevinb): remove this + @ParametricNullness + T apply(@ParametricNullness F input); + +diff --git a/guava/src/com/google/common/base/Functions.java b/guava/src/com/google/common/base/Functions.java +index 5710dcf054..c60e3d74bd 100644 +--- a/guava/src/com/google/common/base/Functions.java ++++ b/guava/src/com/google/common/base/Functions.java +@@ -90,8 +90,8 @@ public final class Functions { + private enum IdentityFunction implements Function<@Nullable Object, @Nullable Object> { + INSTANCE; + +- @Override + @CheckForNull ++ @Override + public Object apply(@CheckForNull Object o) { + return o; + } +diff --git a/guava/src/com/google/common/base/JdkPattern.java b/guava/src/com/google/common/base/JdkPattern.java +index 4788398b7c..a84f7e7479 100644 +--- a/guava/src/com/google/common/base/JdkPattern.java ++++ b/guava/src/com/google/common/base/JdkPattern.java +@@ -14,6 +14,8 @@ + + package com.google.common.base; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtIncompatible; + import java.io.Serializable; + import java.util.regex.Matcher; +@@ -26,7 +28,7 @@ final class JdkPattern extends CommonPattern implements Serializable { + private final Pattern pattern; + + JdkPattern(Pattern pattern) { +- this.pattern = Preconditions.checkNotNull(pattern); ++ this.pattern = checkNotNull(pattern); + } + + @Override +@@ -53,7 +55,7 @@ final class JdkPattern extends CommonPattern implements Serializable { + final Matcher matcher; + + JdkMatcher(Matcher matcher) { +- this.matcher = Preconditions.checkNotNull(matcher); ++ this.matcher = checkNotNull(matcher); + } + + @Override +diff --git a/guava/src/com/google/common/base/Joiner.java b/guava/src/com/google/common/base/Joiner.java +index 8b29f68f8a..0e826848c7 100644 +--- a/guava/src/com/google/common/base/Joiner.java ++++ b/guava/src/com/google/common/base/Joiner.java +@@ -501,8 +501,8 @@ public class Joiner { + return rest.length + 2; + } + +- @Override + @CheckForNull ++ @Override + public Object get(int index) { + switch (index) { + case 0: +diff --git a/guava/src/com/google/common/base/Optional.java b/guava/src/com/google/common/base/Optional.java +index b47705e82f..8e19340919 100644 +--- a/guava/src/com/google/common/base/Optional.java ++++ b/guava/src/com/google/common/base/Optional.java +@@ -342,8 +342,8 @@ public abstract class Optional implements Serializable { + private final Iterator> iterator = + checkNotNull(optionals.iterator()); + +- @Override + @CheckForNull ++ @Override + protected T computeNext() { + while (iterator.hasNext()) { + Optional optional = iterator.next(); +diff --git a/guava/src/com/google/common/base/PairwiseEquivalence.java b/guava/src/com/google/common/base/PairwiseEquivalence.java +index 74be27fd7c..a9d2a4abcd 100644 +--- a/guava/src/com/google/common/base/PairwiseEquivalence.java ++++ b/guava/src/com/google/common/base/PairwiseEquivalence.java +@@ -14,6 +14,8 @@ + + package com.google.common.base; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtCompatible; + import java.io.Serializable; + import java.util.Iterator; +@@ -27,7 +29,7 @@ final class PairwiseEquivalence extends Equivalence elementEquivalence; + + PairwiseEquivalence(Equivalence elementEquivalence) { +- this.elementEquivalence = Preconditions.checkNotNull(elementEquivalence); ++ this.elementEquivalence = checkNotNull(elementEquivalence); + } + + @Override +diff --git a/guava/src/com/google/common/base/Platform.java b/guava/src/com/google/common/base/Platform.java +index 644e89cbfa..cfd969f1f6 100644 +--- a/guava/src/com/google/common/base/Platform.java ++++ b/guava/src/com/google/common/base/Platform.java +@@ -14,6 +14,8 @@ + + package com.google.common.base; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtCompatible; + import java.lang.ref.WeakReference; + import java.util.Locale; +@@ -81,7 +83,7 @@ final class Platform { + } + + static CommonPattern compilePattern(String pattern) { +- Preconditions.checkNotNull(pattern); ++ checkNotNull(pattern); + return patternCompiler.compile(pattern); + } + +diff --git a/guava/src/com/google/common/base/Predicates.java b/guava/src/com/google/common/base/Predicates.java +index 53598571d7..60902f5eec 100644 +--- a/guava/src/com/google/common/base/Predicates.java ++++ b/guava/src/com/google/common/base/Predicates.java +@@ -195,8 +195,8 @@ public final class Predicates { + * + * @since 20.0 (since 10.0 under the incorrect name {@code assignableFrom}) + */ +- @GwtIncompatible // Class.isAssignableFrom +- @Beta ++ @Beta // Class.isAssignableFrom ++ @GwtIncompatible + public static Predicate> subtypeOf(Class clazz) { + return new SubtypeOfPredicate(clazz); + } +@@ -247,7 +247,7 @@ public final class Predicates { + * + * @since 3.0 + */ +- @GwtIncompatible(value = "java.util.regex.Pattern") ++ @GwtIncompatible("java.util.regex.Pattern") + public static Predicate contains(Pattern pattern) { + return new ContainsPatternPredicate(new JdkPattern(pattern)); + } +diff --git a/guava/src/com/google/common/base/Present.java b/guava/src/com/google/common/base/Present.java +index 4e62da29e9..8eb17181c0 100644 +--- a/guava/src/com/google/common/base/Present.java ++++ b/guava/src/com/google/common/base/Present.java +@@ -15,9 +15,9 @@ + package com.google.common.base; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; +-import java.util.Collections; + import java.util.Set; + import javax.annotation.CheckForNull; + +@@ -66,7 +66,7 @@ final class Present extends Optional { + + @Override + public Set asSet() { +- return Collections.singleton(reference); ++ return singleton(reference); + } + + @Override +diff --git a/guava/src/com/google/common/base/Splitter.java b/guava/src/com/google/common/base/Splitter.java +index e60e9887df..db11edf7a4 100644 +--- a/guava/src/com/google/common/base/Splitter.java ++++ b/guava/src/com/google/common/base/Splitter.java +@@ -16,12 +16,13 @@ package com.google.common.base; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.unmodifiableList; ++import static java.util.Collections.unmodifiableMap; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.Iterator; + import java.util.LinkedHashMap; + import java.util.List; +@@ -422,7 +423,7 @@ public final class Splitter { + result.add(iterator.next()); + } + +- return Collections.unmodifiableList(result); ++ return unmodifiableList(result); + } + + /** +@@ -531,7 +532,7 @@ public final class Splitter { + + checkArgument(!entryFields.hasNext(), INVALID_ENTRY_MESSAGE, entry); + } +- return Collections.unmodifiableMap(map); ++ return unmodifiableMap(map); + } + } + +diff --git a/guava/src/com/google/common/base/Suppliers.java b/guava/src/com/google/common/base/Suppliers.java +index 6ced905b98..f16d6d4f66 100644 +--- a/guava/src/com/google/common/base/Suppliers.java ++++ b/guava/src/com/google/common/base/Suppliers.java +@@ -378,8 +378,8 @@ public final class Suppliers { + INSTANCE; + + // Note: This makes T a "pass-through type" +- @Override + @CheckForNull ++ @Override + public Object apply(Supplier<@Nullable Object> input) { + return input.get(); + } +diff --git a/guava/src/com/google/common/base/Throwables.java b/guava/src/com/google/common/base/Throwables.java +index e45ce800cb..3464a28737 100644 +--- a/guava/src/com/google/common/base/Throwables.java ++++ b/guava/src/com/google/common/base/Throwables.java +@@ -30,7 +30,6 @@ import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; + import java.util.AbstractList; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import javax.annotation.CheckForNull; + +@@ -235,8 +234,8 @@ public final class Throwables { + * {@code Throwables.propagate}. + */ + @CanIgnoreReturnValue +- @GwtIncompatible + @Deprecated ++ @GwtIncompatible + public static RuntimeException propagate(Throwable throwable) { + throwIfUnchecked(throwable); + throw new RuntimeException(throwable); +@@ -312,7 +311,7 @@ public final class Throwables { + } + advanceSlowPointer = !advanceSlowPointer; // only advance every other iteration + } +- return Collections.unmodifiableList(causes); ++ return unmodifiableList(causes); + } + + /** +@@ -328,8 +327,8 @@ public final class Throwables { + * ClassCastException}'s cause is {@code throwable}. + * @since 22.0 + */ +- @GwtIncompatible // Class.cast(Object) +- @CheckForNull ++ @CheckForNull // Class.cast(Object) ++ @GwtIncompatible + public static X getCauseAs( + Throwable throwable, Class expectedCauseType) { + try { +@@ -481,8 +480,8 @@ public final class Throwables { + * Returns the JavaLangAccess class that is present in all Sun JDKs. It is not allowed in + * AppEngine, and not present in non-Sun JDKs. + */ +- @GwtIncompatible // java.lang.reflect +- @CheckForNull ++ @CheckForNull // java.lang.reflect ++ @GwtIncompatible + private static Object getJLA() { + try { + /* +@@ -507,8 +506,8 @@ public final class Throwables { + * Returns the Method that can be used to resolve an individual StackTraceElement, or null if that + * method cannot be found (it is only to be found in fairly recent JDKs). + */ +- @GwtIncompatible // java.lang.reflect +- @CheckForNull ++ @CheckForNull // java.lang.reflect ++ @GwtIncompatible + private static Method getGetMethod() { + return getJlaMethod("getStackTraceElement", Throwable.class, int.class); + } +@@ -522,8 +521,8 @@ public final class Throwables { + *

See Throwables#lazyStackTrace throws + * UnsupportedOperationException. + */ +- @GwtIncompatible // java.lang.reflect +- @CheckForNull ++ @CheckForNull // java.lang.reflect ++ @GwtIncompatible + private static Method getSizeMethod(Object jla) { + try { + Method getStackTraceDepth = getJlaMethod("getStackTraceDepth", Throwable.class); +@@ -537,8 +536,8 @@ public final class Throwables { + } + } + +- @GwtIncompatible // java.lang.reflect +- @CheckForNull ++ @CheckForNull // java.lang.reflect ++ @GwtIncompatible + private static Method getJlaMethod(String name, Class... parameterTypes) throws ThreadDeath { + try { + return Class.forName(JAVA_LANG_ACCESS_CLASSNAME, false, null).getMethod(name, parameterTypes); +diff --git a/guava/src/com/google/common/base/internal/Finalizer.java b/guava/src/com/google/common/base/internal/Finalizer.java +index b45ec15787..342cf0ab99 100644 +--- a/guava/src/com/google/common/base/internal/Finalizer.java ++++ b/guava/src/com/google/common/base/internal/Finalizer.java +@@ -138,8 +138,8 @@ public class Finalizer implements Runnable { + } + + /** Loops continuously, pulling references off the queue and cleaning them up. */ +- @SuppressWarnings("InfiniteLoopStatement") + @Override ++ @SuppressWarnings("InfiniteLoopStatement") + public void run() { + while (true) { + try { +diff --git a/guava/src/com/google/common/cache/AbstractCache.java b/guava/src/com/google/common/cache/AbstractCache.java +index 42829c0b23..bd389562fc 100644 +--- a/guava/src/com/google/common/cache/AbstractCache.java ++++ b/guava/src/com/google/common/cache/AbstractCache.java +@@ -234,15 +234,15 @@ public abstract class AbstractCache implements Cache { + missCount.add(count); + } + +- @SuppressWarnings("GoodTime") // b/122668874 +- @Override ++ @Override // b/122668874 ++ @SuppressWarnings("GoodTime") + public void recordLoadSuccess(long loadTime) { + loadSuccessCount.increment(); + totalLoadTime.add(loadTime); + } + +- @SuppressWarnings("GoodTime") // b/122668874 +- @Override ++ @Override // b/122668874 ++ @SuppressWarnings("GoodTime") + public void recordLoadException(long loadTime) { + loadExceptionCount.increment(); + totalLoadTime.add(loadTime); +diff --git a/guava/src/com/google/common/cache/CacheBuilder.java b/guava/src/com/google/common/cache/CacheBuilder.java +index 0ccb9c8c45..64889baa77 100644 +--- a/guava/src/com/google/common/cache/CacheBuilder.java ++++ b/guava/src/com/google/common/cache/CacheBuilder.java +@@ -212,12 +212,12 @@ public final class CacheBuilder { + @Override + public void recordMisses(int count) {} + +- @SuppressWarnings("GoodTime") // b/122668874 +- @Override ++ @Override // b/122668874 ++ @SuppressWarnings("GoodTime") + public void recordLoadSuccess(long loadTime) {} + +- @SuppressWarnings("GoodTime") // b/122668874 +- @Override ++ @Override // b/122668874 ++ @SuppressWarnings("GoodTime") + public void recordLoadException(long loadTime) {} + + @Override +@@ -313,8 +313,8 @@ public final class CacheBuilder { + * + * @since 12.0 + */ +- @GwtIncompatible // To be supported +- @CheckReturnValue ++ @CheckReturnValue // To be supported ++ @GwtIncompatible + public static CacheBuilder from(CacheBuilderSpec spec) { + return spec.toCacheBuilder().lenientParsing(); + } +@@ -326,8 +326,8 @@ public final class CacheBuilder { + * @param spec a String in the format specified by {@link CacheBuilderSpec} + * @since 12.0 + */ +- @GwtIncompatible // To be supported +- @CheckReturnValue ++ @CheckReturnValue // To be supported ++ @GwtIncompatible + public static CacheBuilder from(String spec) { + return from(CacheBuilderSpec.parse(spec)); + } +@@ -695,8 +695,8 @@ public final class CacheBuilder { + * @throws ArithmeticException for durations greater than +/- approximately 292 years + * @since 25.0 + */ +- @J2ObjCIncompatible +- @GwtIncompatible // java.time.Duration ++ @GwtIncompatible ++ @J2ObjCIncompatible // java.time.Duration + @SuppressWarnings("GoodTime") // java.time.Duration decomposition + public CacheBuilder expireAfterWrite(java.time.Duration duration) { + return expireAfterWrite(toNanosSaturated(duration), TimeUnit.NANOSECONDS); +@@ -765,8 +765,8 @@ public final class CacheBuilder { + * @throws ArithmeticException for durations greater than +/- approximately 292 years + * @since 25.0 + */ +- @J2ObjCIncompatible +- @GwtIncompatible // java.time.Duration ++ @GwtIncompatible ++ @J2ObjCIncompatible // java.time.Duration + @SuppressWarnings("GoodTime") // java.time.Duration decomposition + public CacheBuilder expireAfterAccess(java.time.Duration duration) { + return expireAfterAccess(toNanosSaturated(duration), TimeUnit.NANOSECONDS); +@@ -843,8 +843,8 @@ public final class CacheBuilder { + * @throws ArithmeticException for durations greater than +/- approximately 292 years + * @since 25.0 + */ +- @J2ObjCIncompatible +- @GwtIncompatible // java.time.Duration ++ @GwtIncompatible ++ @J2ObjCIncompatible // java.time.Duration + @SuppressWarnings("GoodTime") // java.time.Duration decomposition + public CacheBuilder refreshAfterWrite(java.time.Duration duration) { + return refreshAfterWrite(toNanosSaturated(duration), TimeUnit.NANOSECONDS); +diff --git a/guava/src/com/google/common/cache/ForwardingCache.java b/guava/src/com/google/common/cache/ForwardingCache.java +index 2d3a2b5fd2..9988243074 100644 +--- a/guava/src/com/google/common/cache/ForwardingCache.java ++++ b/guava/src/com/google/common/cache/ForwardingCache.java +@@ -14,8 +14,9 @@ + + package com.google.common.cache; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.collect.ForwardingObject; + import com.google.common.collect.ImmutableMap; + import java.util.Map; +@@ -45,8 +46,8 @@ public abstract class ForwardingCache extends ForwardingObject implements + /** + * @since 11.0 + */ +- @Override + @CheckForNull ++ @Override + public V getIfPresent(Object key) { + return delegate().getIfPresent(key); + } +@@ -136,7 +137,7 @@ public abstract class ForwardingCache extends ForwardingObject implements + private final Cache delegate; + + protected SimpleForwardingCache(Cache delegate) { +- this.delegate = Preconditions.checkNotNull(delegate); ++ this.delegate = checkNotNull(delegate); + } + + @Override +diff --git a/guava/src/com/google/common/cache/ForwardingLoadingCache.java b/guava/src/com/google/common/cache/ForwardingLoadingCache.java +index ecd44ca8d8..78d0bb911d 100644 +--- a/guava/src/com/google/common/cache/ForwardingLoadingCache.java ++++ b/guava/src/com/google/common/cache/ForwardingLoadingCache.java +@@ -14,8 +14,9 @@ + + package com.google.common.cache; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableMap; + import java.util.concurrent.ExecutionException; + +@@ -77,7 +78,7 @@ public abstract class ForwardingLoadingCache extends ForwardingCache + private final LoadingCache delegate; + + protected SimpleForwardingLoadingCache(LoadingCache delegate) { +- this.delegate = Preconditions.checkNotNull(delegate); ++ this.delegate = checkNotNull(delegate); + } + + @Override +diff --git a/guava/src/com/google/common/cache/LocalCache.java b/guava/src/com/google/common/cache/LocalCache.java +index 584298e4da..4bd3b963ea 100644 +--- a/guava/src/com/google/common/cache/LocalCache.java ++++ b/guava/src/com/google/common/cache/LocalCache.java +@@ -3374,8 +3374,8 @@ class LocalCache extends AbstractMap implements ConcurrentMap + } + } + +- @VisibleForTesting + @GuardedBy("this") ++ @VisibleForTesting + boolean removeEntry(ReferenceEntry entry, int hash, RemovalCause cause) { + int newCount = this.count - 1; + AtomicReferenceArray> table = this.table; +@@ -4299,8 +4299,8 @@ class LocalCache extends AbstractMap implements ConcurrentMap + + @RetainedWith @Nullable Set> entrySet; + +- @Override +- @GwtIncompatible // Not supported. ++ @GwtIncompatible ++ @Override // Not supported. + public Set> entrySet() { + // does not impact recency ordering + Set> es = entrySet; +diff --git a/guava/src/com/google/common/collect/AbstractBiMap.java b/guava/src/com/google/common/collect/AbstractBiMap.java +index bf97e1a7c8..b8b39bc14a 100644 +--- a/guava/src/com/google/common/collect/AbstractBiMap.java ++++ b/guava/src/com/google/common/collect/AbstractBiMap.java +@@ -117,15 +117,15 @@ abstract class AbstractBiMap createUnmodifiableEmptyCollection() { +- return Collections.emptyList(); ++ return emptyList(); + } + + @Override + Collection unmodifiableCollectionSubclass( + Collection collection) { +- return Collections.unmodifiableList((List) collection); ++ return unmodifiableList((List) collection); + } + + @Override +diff --git a/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java b/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java +index 4c5a0f0418..32c78b6a85 100644 +--- a/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java ++++ b/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java +@@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkState; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableCollection; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.GwtCompatible; +@@ -28,7 +29,6 @@ import com.google.j2objc.annotations.WeakOuter; + import java.io.Serializable; + import java.util.AbstractCollection; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.ConcurrentModificationException; + import java.util.Iterator; +@@ -266,7 +266,7 @@ abstract class AbstractMapBasedMultimap Collection unmodifiableCollectionSubclass( + Collection collection) { +- return Collections.unmodifiableCollection(collection); ++ return unmodifiableCollection(collection); + } + + @Override +@@ -635,8 +635,8 @@ abstract class AbstractMapBasedMultimap) getDelegate(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return getSortedSetDelegate().comparator(); + } +@@ -697,38 +697,38 @@ abstract class AbstractMapBasedMultimap) super.getSortedSetDelegate(); + } + +- @Override + @CheckForNull ++ @Override + public V lower(@ParametricNullness V v) { + return getSortedSetDelegate().lower(v); + } + +- @Override + @CheckForNull ++ @Override + public V floor(@ParametricNullness V v) { + return getSortedSetDelegate().floor(v); + } + +- @Override + @CheckForNull ++ @Override + public V ceiling(@ParametricNullness V v) { + return getSortedSetDelegate().ceiling(v); + } + +- @Override + @CheckForNull ++ @Override + public V higher(@ParametricNullness V v) { + return getSortedSetDelegate().higher(v); + } + +- @Override + @CheckForNull ++ @Override + public V pollFirst() { + return Iterators.pollNext(iterator()); + } + +- @Override + @CheckForNull ++ @Override + public V pollLast() { + return Iterators.pollNext(descendingIterator()); + } +@@ -1028,8 +1028,8 @@ abstract class AbstractMapBasedMultimap>) super.map(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return sortedMap().comparator(); + } +@@ -1073,38 +1073,38 @@ abstract class AbstractMapBasedMultimap>) super.sortedMap(); + } + +- @Override + @CheckForNull ++ @Override + public K lower(@ParametricNullness K k) { + return sortedMap().lowerKey(k); + } + +- @Override + @CheckForNull ++ @Override + public K floor(@ParametricNullness K k) { + return sortedMap().floorKey(k); + } + +- @Override + @CheckForNull ++ @Override + public K ceiling(@ParametricNullness K k) { + return sortedMap().ceilingKey(k); + } + +- @Override + @CheckForNull ++ @Override + public K higher(@ParametricNullness K k) { + return sortedMap().higherKey(k); + } + +- @Override + @CheckForNull ++ @Override + public K pollFirst() { + return Iterators.pollNext(iterator()); + } + +- @Override + @CheckForNull ++ @Override + public K pollLast() { + return Iterators.pollNext(descendingIterator()); + } +@@ -1361,8 +1361,8 @@ abstract class AbstractMapBasedMultimap get(@CheckForNull Object key) { + Collection collection = Maps.safeGet(submap, key); + if (collection == null) { +@@ -1383,8 +1383,8 @@ abstract class AbstractMapBasedMultimap remove(@CheckForNull Object key) { + Collection collection = submap.remove(key); + if (collection == null) { +@@ -1501,8 +1501,8 @@ abstract class AbstractMapBasedMultimap>) submap; + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return sortedMap().comparator(); + } +@@ -1562,80 +1562,80 @@ abstract class AbstractMapBasedMultimap>) super.sortedMap(); + } + +- @Override + @CheckForNull ++ @Override + public Entry> lowerEntry(@ParametricNullness K key) { + Entry> entry = sortedMap().lowerEntry(key); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(@ParametricNullness K key) { + return sortedMap().lowerKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry> floorEntry(@ParametricNullness K key) { + Entry> entry = sortedMap().floorEntry(key); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(@ParametricNullness K key) { + return sortedMap().floorKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry> ceilingEntry(@ParametricNullness K key) { + Entry> entry = sortedMap().ceilingEntry(key); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(@ParametricNullness K key) { + return sortedMap().ceilingKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry> higherEntry(@ParametricNullness K key) { + Entry> entry = sortedMap().higherEntry(key); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(@ParametricNullness K key) { + return sortedMap().higherKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry> firstEntry() { + Entry> entry = sortedMap().firstEntry(); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public Entry> lastEntry() { + Entry> entry = sortedMap().lastEntry(); + return (entry == null) ? null : wrapEntry(entry); + } + +- @Override + @CheckForNull ++ @Override + public Entry> pollFirstEntry() { + return pollAsMapEntry(entrySet().iterator()); + } + +- @Override + @CheckForNull ++ @Override + public Entry> pollLastEntry() { + return pollAsMapEntry(descendingMap().entrySet().iterator()); + } +diff --git a/guava/src/com/google/common/collect/AbstractNavigableMap.java b/guava/src/com/google/common/collect/AbstractNavigableMap.java +index 47048d06ac..83733923f6 100644 +--- a/guava/src/com/google/common/collect/AbstractNavigableMap.java ++++ b/guava/src/com/google/common/collect/AbstractNavigableMap.java +@@ -37,30 +37,30 @@ import org.checkerframework.checker.nullness.qual.Nullable; + abstract class AbstractNavigableMap + extends IteratorBasedAbstractMap implements NavigableMap { + +- @Override + @CheckForNull ++ @Override + public abstract V get(@CheckForNull Object key); + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return Iterators.getNext(entryIterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return Iterators.getNext(descendingEntryIterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return Iterators.pollNext(entryIterator()); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return Iterators.pollNext(descendingEntryIterator()); + } +@@ -87,50 +87,50 @@ abstract class AbstractNavigableMap lowerEntry(@ParametricNullness K key) { + return headMap(key, false).lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry floorEntry(@ParametricNullness K key) { + return headMap(key, true).lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry ceilingEntry(@ParametricNullness K key) { + return tailMap(key, true).firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry higherEntry(@ParametricNullness K key) { + return tailMap(key, false).firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(@ParametricNullness K key) { + return Maps.keyOrNull(lowerEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(@ParametricNullness K key) { + return Maps.keyOrNull(floorEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(@ParametricNullness K key) { + return Maps.keyOrNull(ceilingEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(@ParametricNullness K key) { + return Maps.keyOrNull(higherEntry(key)); + } +diff --git a/guava/src/com/google/common/collect/AbstractRangeSet.java b/guava/src/com/google/common/collect/AbstractRangeSet.java +index d112a11f18..8ce6cac8da 100644 +--- a/guava/src/com/google/common/collect/AbstractRangeSet.java ++++ b/guava/src/com/google/common/collect/AbstractRangeSet.java +@@ -32,8 +32,8 @@ abstract class AbstractRangeSet implements RangeSet { + return rangeContaining(value) != null; + } + +- @Override + @CheckForNull ++ @Override + public abstract Range rangeContaining(C value); + + @Override +diff --git a/guava/src/com/google/common/collect/AbstractSetMultimap.java b/guava/src/com/google/common/collect/AbstractSetMultimap.java +index 90aa9dcb2f..08e5315c7c 100644 +--- a/guava/src/com/google/common/collect/AbstractSetMultimap.java ++++ b/guava/src/com/google/common/collect/AbstractSetMultimap.java +@@ -16,10 +16,12 @@ + + package com.google.common.collect; + ++import static java.util.Collections.emptySet; ++import static java.util.Collections.unmodifiableSet; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.Collection; +-import java.util.Collections; + import java.util.Map; + import java.util.Map.Entry; + import java.util.Set; +@@ -51,13 +53,13 @@ abstract class AbstractSetMultimap createUnmodifiableEmptyCollection() { +- return Collections.emptySet(); ++ return emptySet(); + } + + @Override + Collection unmodifiableCollectionSubclass( + Collection collection) { +- return Collections.unmodifiableSet((Set) collection); ++ return unmodifiableSet((Set) collection); + } + + @Override +diff --git a/guava/src/com/google/common/collect/AbstractSortedMultiset.java b/guava/src/com/google/common/collect/AbstractSortedMultiset.java +index 621e8f98a5..688fcc49d3 100644 +--- a/guava/src/com/google/common/collect/AbstractSortedMultiset.java ++++ b/guava/src/com/google/common/collect/AbstractSortedMultiset.java +@@ -64,22 +64,22 @@ abstract class AbstractSortedMultiset extends Abstra + return comparator; + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + Iterator> entryIterator = entryIterator(); + return entryIterator.hasNext() ? entryIterator.next() : null; + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + Iterator> entryIterator = descendingEntryIterator(); + return entryIterator.hasNext() ? entryIterator.next() : null; + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + Iterator> entryIterator = entryIterator(); + if (entryIterator.hasNext()) { +@@ -91,8 +91,8 @@ abstract class AbstractSortedMultiset extends Abstra + return null; + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + Iterator> entryIterator = descendingEntryIterator(); + if (entryIterator.hasNext()) { +diff --git a/guava/src/com/google/common/collect/AbstractSortedSetMultimap.java b/guava/src/com/google/common/collect/AbstractSortedSetMultimap.java +index 32316133a0..e83c22e8fc 100644 +--- a/guava/src/com/google/common/collect/AbstractSortedSetMultimap.java ++++ b/guava/src/com/google/common/collect/AbstractSortedSetMultimap.java +@@ -16,10 +16,11 @@ + + package com.google.common.collect; + ++import static java.util.Collections.unmodifiableSortedSet; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.Collection; +-import java.util.Collections; + import java.util.Map; + import java.util.NavigableSet; + import java.util.SortedSet; +@@ -60,7 +61,7 @@ abstract class AbstractSortedSetMultimap) collection); + } else { +- return Collections.unmodifiableSortedSet((SortedSet) collection); ++ return unmodifiableSortedSet((SortedSet) collection); + } + } + +diff --git a/guava/src/com/google/common/collect/AbstractTable.java b/guava/src/com/google/common/collect/AbstractTable.java +index 99a1215906..5cc9ca4306 100644 +--- a/guava/src/com/google/common/collect/AbstractTable.java ++++ b/guava/src/com/google/common/collect/AbstractTable.java +@@ -75,8 +75,8 @@ abstract class AbstractTable< + return row != null && Maps.safeContainsKey(row, columnKey); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + Map row = Maps.safeGet(rowMap(), rowKey); + return (row == null) ? null : Maps.safeGet(row, columnKey); +@@ -93,16 +93,16 @@ abstract class AbstractTable< + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + Map row = Maps.safeGet(rowMap(), rowKey); + return (row == null) ? null : Maps.safeRemove(row, columnKey); + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V put( + @ParametricNullness R rowKey, @ParametricNullness C columnKey, @ParametricNullness V value) { + return row(rowKey).put(columnKey, value); +diff --git a/guava/src/com/google/common/collect/AllEqualOrdering.java b/guava/src/com/google/common/collect/AllEqualOrdering.java +index f6ca6faff7..dfb7c1f4af 100644 +--- a/guava/src/com/google/common/collect/AllEqualOrdering.java ++++ b/guava/src/com/google/common/collect/AllEqualOrdering.java +@@ -48,8 +48,8 @@ final class AllEqualOrdering extends Ordering<@Nullable Object> implements Seria + return ImmutableList.copyOf(iterable); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Ordering reverse() { + return (Ordering) this; + } +diff --git a/guava/src/com/google/common/collect/ArrayTable.java b/guava/src/com/google/common/collect/ArrayTable.java +index 1349386d68..9eca162b46 100644 +--- a/guava/src/com/google/common/collect/ArrayTable.java ++++ b/guava/src/com/google/common/collect/ArrayTable.java +@@ -276,8 +276,8 @@ public final class ArrayTable extends AbstractTable + } + } + +- @Override + @CheckForNull ++ @Override + public V put(K key, @ParametricNullness V value) { + Integer index = keyIndex.get(key); + if (index == null) { +@@ -287,8 +287,8 @@ public final class ArrayTable extends AbstractTable + return setValue(index, value); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + throw new UnsupportedOperationException(); + } +@@ -385,9 +385,9 @@ public final class ArrayTable extends AbstractTable + * @throws UnsupportedOperationException always + * @deprecated Use {@link #eraseAll} + */ ++ @Deprecated + @DoNotCall("Always throws UnsupportedOperationException") + @Override +- @Deprecated + public void clear() { + throw new UnsupportedOperationException(); + } +@@ -438,8 +438,8 @@ public final class ArrayTable extends AbstractTable + return false; + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + Integer rowIndex = rowKeyToIndex.get(rowKey); + Integer columnIndex = columnKeyToIndex.get(columnKey); +@@ -461,8 +461,8 @@ public final class ArrayTable extends AbstractTable + * columnKey} is not in {@link #columnKeySet()}. + */ + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V put(R rowKey, C columnKey, @CheckForNull V value) { + checkNotNull(rowKey); + checkNotNull(columnKey); +@@ -499,11 +499,11 @@ public final class ArrayTable extends AbstractTable + * @throws UnsupportedOperationException always + * @deprecated Use {@link #erase} + */ +- @DoNotCall("Always throws UnsupportedOperationException") + @CanIgnoreReturnValue +- @Override +- @Deprecated + @CheckForNull ++ @Deprecated ++ @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + throw new UnsupportedOperationException(); + } +@@ -586,8 +586,8 @@ public final class ArrayTable extends AbstractTable + return columnList.get(columnIndex); + } + +- @Override + @CheckForNull ++ @Override + public V getValue() { + return at(rowIndex, columnIndex); + } +@@ -636,14 +636,14 @@ public final class ArrayTable extends AbstractTable + return "Row"; + } + +- @Override + @CheckForNull ++ @Override + V getValue(int index) { + return at(index, columnIndex); + } + +- @Override + @CheckForNull ++ @Override + V setValue(int index, @CheckForNull V newValue) { + return set(index, columnIndex, newValue); + } +@@ -689,8 +689,8 @@ public final class ArrayTable extends AbstractTable + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public Map put(C key, Map value) { + throw new UnsupportedOperationException(); + } +@@ -731,14 +731,14 @@ public final class ArrayTable extends AbstractTable + return "Column"; + } + +- @Override + @CheckForNull ++ @Override + V getValue(int index) { + return at(rowIndex, index); + } + +- @Override + @CheckForNull ++ @Override + V setValue(int index, @CheckForNull V newValue) { + return set(rowIndex, index, newValue); + } +@@ -784,8 +784,8 @@ public final class ArrayTable extends AbstractTable + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public Map put(R key, Map value) { + throw new UnsupportedOperationException(); + } +@@ -808,8 +808,8 @@ public final class ArrayTable extends AbstractTable + @Override + Iterator<@Nullable V> valuesIterator() { + return new AbstractIndexedListIterator<@Nullable V>(size()) { +- @Override + @CheckForNull ++ @Override + protected V get(int index) { + return getValue(index); + } +diff --git a/guava/src/com/google/common/collect/BiMap.java b/guava/src/com/google/common/collect/BiMap.java +index 12eb4e3e1b..7c24cf3e84 100644 +--- a/guava/src/com/google/common/collect/BiMap.java ++++ b/guava/src/com/google/common/collect/BiMap.java +@@ -47,8 +47,8 @@ public interface BiMap e + * #forcePut} instead. + */ + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + V put(@ParametricNullness K key, @ParametricNullness V value); + + /** +diff --git a/guava/src/com/google/common/collect/CollectCollectors.java b/guava/src/com/google/common/collect/CollectCollectors.java +index f582660c8e..6744b7910c 100644 +--- a/guava/src/com/google/common/collect/CollectCollectors.java ++++ b/guava/src/com/google/common/collect/CollectCollectors.java +@@ -18,6 +18,7 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkNotNull; + import static java.util.stream.Collectors.collectingAndThen; ++import static java.util.stream.Collectors.toMap; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -33,7 +34,6 @@ import java.util.function.Function; + import java.util.function.Supplier; + import java.util.function.ToIntFunction; + import java.util.stream.Collector; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + import javax.annotation.CheckForNull; + import org.checkerframework.checker.nullness.qual.Nullable; +@@ -196,8 +196,7 @@ final class CollectCollectors { + checkNotNull(valueFunction); + checkNotNull(mergeFunction); + return collectingAndThen( +- Collectors.toMap(keyFunction, valueFunction, mergeFunction, LinkedHashMap::new), +- ImmutableMap::copyOf); ++ toMap(keyFunction, valueFunction, mergeFunction, LinkedHashMap::new), ImmutableMap::copyOf); + } + + static +@@ -231,8 +230,7 @@ final class CollectCollectors { + checkNotNull(valueFunction); + checkNotNull(mergeFunction); + return collectingAndThen( +- Collectors.toMap( +- keyFunction, valueFunction, mergeFunction, () -> new TreeMap(comparator)), ++ toMap(keyFunction, valueFunction, mergeFunction, () -> new TreeMap(comparator)), + ImmutableSortedMap::copyOfSorted); + } + +diff --git a/guava/src/com/google/common/collect/CollectSpliterators.java b/guava/src/com/google/common/collect/CollectSpliterators.java +index 7d0e82f203..e695d84490 100644 +--- a/guava/src/com/google/common/collect/CollectSpliterators.java ++++ b/guava/src/com/google/common/collect/CollectSpliterators.java +@@ -72,8 +72,8 @@ final class CollectSpliterators { + delegate.forEachRemaining((IntConsumer) i -> action.accept(function.apply(i))); + } + +- @Override + @CheckForNull ++ @Override + public Spliterator trySplit() { + Spliterator.OfInt split = delegate.trySplit(); + return (split == null) ? null : new WithCharacteristics(split); +@@ -92,8 +92,8 @@ final class CollectSpliterators { + | extraCharacteristics; + } + +- @Override + @CheckForNull ++ @Override + public Comparator getComparator() { + if (hasCharacteristics(Spliterator.SORTED)) { + return comparator; +@@ -128,8 +128,8 @@ final class CollectSpliterators { + fromSpliterator.forEachRemaining(fromElement -> action.accept(function.apply(fromElement))); + } + +- @Override + @CheckForNull ++ @Override + public Spliterator trySplit() { + Spliterator fromSplit = fromSpliterator.trySplit(); + return (fromSplit != null) ? map(fromSplit, function) : null; +@@ -178,8 +178,8 @@ final class CollectSpliterators { + return false; + } + +- @Override + @CheckForNull ++ @Override + public Spliterator trySplit() { + Spliterator fromSplit = fromSpliterator.trySplit(); + return (fromSplit == null) ? null : filter(fromSplit, predicate); +@@ -190,8 +190,8 @@ final class CollectSpliterators { + return fromSpliterator.estimateSize() / 2; + } + +- @Override + @CheckForNull ++ @Override + public Comparator getComparator() { + return fromSpliterator.getComparator(); + } +@@ -381,8 +381,8 @@ final class CollectSpliterators { + estimatedSize = 0; + } + +- @Override + @CheckForNull ++ @Override + public final OutSpliteratorT trySplit() { + Spliterator fromSplit = from.trySplit(); + if (fromSplit != null) { +diff --git a/guava/src/com/google/common/collect/Collections2.java b/guava/src/com/google/common/collect/Collections2.java +index eb928596a3..eb36002988 100644 +--- a/guava/src/com/google/common/collect/Collections2.java ++++ b/guava/src/com/google/common/collect/Collections2.java +@@ -19,6 +19,7 @@ package com.google.common.collect; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; ++import static java.util.Collections.reverse; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -518,8 +519,8 @@ public final class Collections2 { + this.comparator = comparator; + } + +- @Override + @CheckForNull ++ @Override + protected List computeNext() { + if (nextPermutation == null) { + return endOfData(); +@@ -544,7 +545,7 @@ public final class Collections2 { + int l = findNextL(j); + Collections.swap(nextPermutation, j, l); + int n = nextPermutation.size(); +- Collections.reverse(nextPermutation.subList(j + 1, n)); ++ reverse(nextPermutation.subList(j + 1, n)); + } + + int findNextJ() { +@@ -652,8 +653,8 @@ public final class Collections2 { + j = Integer.MAX_VALUE; + } + +- @Override + @CheckForNull ++ @Override + protected List computeNext() { + if (j <= 0) { + return endOfData(); +diff --git a/guava/src/com/google/common/collect/CompactHashMap.java b/guava/src/com/google/common/collect/CompactHashMap.java +index c18c207a89..405d38f297 100644 +--- a/guava/src/com/google/common/collect/CompactHashMap.java ++++ b/guava/src/com/google/common/collect/CompactHashMap.java +@@ -16,7 +16,9 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkState; + import static com.google.common.collect.CollectPreconditions.checkRemove; + import static com.google.common.collect.CompactHashing.UNSET; + import static com.google.common.collect.Hashing.smearedHash; +@@ -27,7 +29,6 @@ import static java.util.Objects.requireNonNull; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.base.Objects; +-import com.google.common.base.Preconditions; + import com.google.common.primitives.Ints; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.j2objc.annotations.WeakOuter; +@@ -117,7 +118,7 @@ class CompactHashMap + * Maximum allowed false positive probability of detecting a hash flooding attack given random + * input. + */ +- @VisibleForTesting() static final double HASH_FLOODING_FPP = 0.001; ++ @VisibleForTesting static final double HASH_FLOODING_FPP = 0.001; + + /** + * Maximum allowed length of a hash table bucket before falling back to a j.u.LinkedHashMap-based +@@ -248,7 +249,7 @@ class CompactHashMap + + /** Pseudoconstructor for serialization support. */ + void init(int expectedSize) { +- Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0"); ++ checkArgument(expectedSize >= 0, "Expected size must be >= 0"); + + // Save expectedSize for use in allocArrays() + this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE); +@@ -263,7 +264,7 @@ class CompactHashMap + /** Handle lazy allocation of arrays. */ + @CanIgnoreReturnValue + int allocArrays() { +- Preconditions.checkState(needsAllocArrays(), "Arrays already allocated"); ++ checkState(needsAllocArrays(), "Arrays already allocated"); + + int expectedSize = metadata; + int buckets = CompactHashing.tableSize(expectedSize); +@@ -277,9 +278,9 @@ class CompactHashMap + return expectedSize; + } + ++ @CheckForNull + @SuppressWarnings("unchecked") + @VisibleForTesting +- @CheckForNull + Map delegateOrNull() { + if (table instanceof Map) { + return (Map) table; +@@ -291,8 +292,8 @@ class CompactHashMap + return new LinkedHashMap<>(tableSize, 1.0f); + } + +- @VisibleForTesting + @CanIgnoreReturnValue ++ @VisibleForTesting + Map convertToHashFloodingResistantImplementation() { + Map newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1); + for (int i = firstEntryIndex(); i >= 0; i = getSuccessor(i)) { +@@ -331,8 +332,8 @@ class CompactHashMap + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V put(@ParametricNullness K key, @ParametricNullness V value) { + if (needsAllocArrays()) { + allocArrays(); +@@ -506,8 +507,8 @@ class CompactHashMap + return (delegate != null) ? delegate.containsKey(key) : indexOf(key) != -1; + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + Map delegate = delegateOrNull(); + if (delegate != null) { +@@ -522,9 +523,9 @@ class CompactHashMap + } + + @CanIgnoreReturnValue +- @SuppressWarnings("unchecked") // known to be a V ++ @CheckForNull // known to be a V + @Override +- @CheckForNull ++ @SuppressWarnings("unchecked") + public V remove(@CheckForNull Object key) { + Map delegate = delegateOrNull(); + if (delegate != null) { +diff --git a/guava/src/com/google/common/collect/CompactHashSet.java b/guava/src/com/google/common/collect/CompactHashSet.java +index 4ffd8e6e10..7f20800908 100644 +--- a/guava/src/com/google/common/collect/CompactHashSet.java ++++ b/guava/src/com/google/common/collect/CompactHashSet.java +@@ -16,7 +16,9 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkState; + import static com.google.common.collect.CollectPreconditions.checkRemove; + import static com.google.common.collect.CompactHashing.UNSET; + import static com.google.common.collect.Hashing.smearedHash; +@@ -25,7 +27,6 @@ import static java.util.Objects.requireNonNull; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.base.Objects; +-import com.google.common.base.Preconditions; + import com.google.common.primitives.Ints; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.io.IOException; +@@ -131,7 +132,7 @@ class CompactHashSet extends AbstractSet implemen + * Maximum allowed false positive probability of detecting a hash flooding attack given random + * input. + */ +- @VisibleForTesting() static final double HASH_FLOODING_FPP = 0.001; ++ @VisibleForTesting static final double HASH_FLOODING_FPP = 0.001; + + /** + * Maximum allowed length of a hash table bucket before falling back to a j.u.LinkedHashSet based +@@ -214,7 +215,7 @@ class CompactHashSet extends AbstractSet implemen + + /** Pseudoconstructor for serialization support. */ + void init(int expectedSize) { +- Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0"); ++ checkArgument(expectedSize >= 0, "Expected size must be >= 0"); + + // Save expectedSize for use in allocArrays() + this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE); +@@ -229,7 +230,7 @@ class CompactHashSet extends AbstractSet implemen + /** Handle lazy allocation of arrays. */ + @CanIgnoreReturnValue + int allocArrays() { +- Preconditions.checkState(needsAllocArrays(), "Arrays already allocated"); ++ checkState(needsAllocArrays(), "Arrays already allocated"); + + int expectedSize = metadata; + int buckets = CompactHashing.tableSize(expectedSize); +@@ -242,9 +243,9 @@ class CompactHashSet extends AbstractSet implemen + return expectedSize; + } + ++ @CheckForNull + @SuppressWarnings("unchecked") + @VisibleForTesting +- @CheckForNull + Set delegateOrNull() { + if (table instanceof Set) { + return (Set) table; +@@ -256,8 +257,8 @@ class CompactHashSet extends AbstractSet implemen + return new LinkedHashSet<>(tableSize, 1.0f); + } + +- @VisibleForTesting + @CanIgnoreReturnValue ++ @VisibleForTesting + Set convertToHashFloodingResistantImplementation() { + Set newDelegate = createHashFloodingResistantDelegate(hashTableMask() + 1); + for (int i = firstEntryIndex(); i >= 0; i = getSuccessor(i)) { +diff --git a/guava/src/com/google/common/collect/CompactLinkedHashMap.java b/guava/src/com/google/common/collect/CompactLinkedHashMap.java +index 97b3a4b1c3..04ef58994c 100644 +--- a/guava/src/com/google/common/collect/CompactLinkedHashMap.java ++++ b/guava/src/com/google/common/collect/CompactLinkedHashMap.java +@@ -131,8 +131,8 @@ class CompactLinkedHashMap(tableSize, 1.0f, accessOrder); + } + +- @Override + @CanIgnoreReturnValue ++ @Override + Map convertToHashFloodingResistantImplementation() { + Map result = super.convertToHashFloodingResistantImplementation(); + links = null; +diff --git a/guava/src/com/google/common/collect/CompactLinkedHashSet.java b/guava/src/com/google/common/collect/CompactLinkedHashSet.java +index c1d813cdb4..150005213a 100644 +--- a/guava/src/com/google/common/collect/CompactLinkedHashSet.java ++++ b/guava/src/com/google/common/collect/CompactLinkedHashSet.java +@@ -148,8 +148,8 @@ class CompactLinkedHashSet extends CompactHashSet + return expectedSize; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + Set convertToHashFloodingResistantImplementation() { + Set result = super.convertToHashFloodingResistantImplementation(); + this.predecessor = null; +diff --git a/guava/src/com/google/common/collect/Comparators.java b/guava/src/com/google/common/collect/Comparators.java +index 5779be31bf..e0ba002403 100644 +--- a/guava/src/com/google/common/collect/Comparators.java ++++ b/guava/src/com/google/common/collect/Comparators.java +@@ -18,6 +18,8 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; ++import static java.util.Comparator.nullsFirst; ++import static java.util.Comparator.nullsLast; + + import com.google.common.annotations.GwtCompatible; + import java.util.Comparator; +@@ -177,7 +179,7 @@ public final class Comparators { + public static Comparator> emptiesFirst(Comparator valueComparator) { + checkNotNull(valueComparator); + return Comparator., @Nullable T>comparing( +- o -> o.orElse(null), Comparator.nullsFirst(valueComparator)); ++ o -> o.orElse(null), nullsFirst(valueComparator)); + } + + /** +@@ -190,7 +192,7 @@ public final class Comparators { + public static Comparator> emptiesLast(Comparator valueComparator) { + checkNotNull(valueComparator); + return Comparator., @Nullable T>comparing( +- o -> o.orElse(null), Comparator.nullsLast(valueComparator)); ++ o -> o.orElse(null), nullsLast(valueComparator)); + } + + /** +diff --git a/guava/src/com/google/common/collect/ComparisonChain.java b/guava/src/com/google/common/collect/ComparisonChain.java +index 9c05205ec0..06fa13ae91 100644 +--- a/guava/src/com/google/common/collect/ComparisonChain.java ++++ b/guava/src/com/google/common/collect/ComparisonChain.java +@@ -68,8 +68,8 @@ public abstract class ComparisonChain { + + private static final ComparisonChain ACTIVE = + new ComparisonChain() { +- @SuppressWarnings("unchecked") // unsafe; see discussion on supertype +- @Override ++ @Override // unsafe; see discussion on supertype ++ @SuppressWarnings("unchecked") + public ComparisonChain compare(Comparable left, Comparable right) { + return classify(((Comparable) left).compareTo(right)); + } +diff --git a/guava/src/com/google/common/collect/ConcurrentHashMultiset.java b/guava/src/com/google/common/collect/ConcurrentHashMultiset.java +index f60e2081e3..f212910ca9 100644 +--- a/guava/src/com/google/common/collect/ConcurrentHashMultiset.java ++++ b/guava/src/com/google/common/collect/ConcurrentHashMultiset.java +@@ -510,8 +510,8 @@ public final class ConcurrentHashMultiset extends AbstractMultiset impleme + private final Iterator> mapEntries = + countMap.entrySet().iterator(); + +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + while (true) { + if (!mapEntries.hasNext()) { +diff --git a/guava/src/com/google/common/collect/ConsumingQueueIterator.java b/guava/src/com/google/common/collect/ConsumingQueueIterator.java +index 7721e1277c..3e79c7adc2 100644 +--- a/guava/src/com/google/common/collect/ConsumingQueueIterator.java ++++ b/guava/src/com/google/common/collect/ConsumingQueueIterator.java +@@ -34,8 +34,8 @@ final class ConsumingQueueIterator extends AbstractI + this.queue = checkNotNull(queue); + } + +- @Override + @CheckForNull ++ @Override + public T computeNext() { + // TODO(b/192579700): Use a ternary once it no longer confuses our nullness checker. + if (queue.isEmpty()) { +diff --git a/guava/src/com/google/common/collect/ContiguousSet.java b/guava/src/com/google/common/collect/ContiguousSet.java +index d08af0d0ce..d06b206600 100644 +--- a/guava/src/com/google/common/collect/ContiguousSet.java ++++ b/guava/src/com/google/common/collect/ContiguousSet.java +@@ -245,8 +245,8 @@ public abstract class ContiguousSet extends ImmutableSorte + */ + public abstract Range range(BoundType lowerBoundType, BoundType upperBoundType); + +- @Override +- @GwtIncompatible // NavigableSet ++ @GwtIncompatible ++ @Override // NavigableSet + ImmutableSortedSet createDescendingSet() { + return new DescendingImmutableSortedSet<>(this); + } +diff --git a/guava/src/com/google/common/collect/Cut.java b/guava/src/com/google/common/collect/Cut.java +index 21fe5ff2dd..c5140cfe46 100644 +--- a/guava/src/com/google/common/collect/Cut.java ++++ b/guava/src/com/google/common/collect/Cut.java +@@ -89,8 +89,8 @@ abstract class Cut implements Comparable>, Serializ + return endpoint; + } + +- @SuppressWarnings("unchecked") // catching CCE +- @Override ++ @Override // catching CCE ++ @SuppressWarnings("unchecked") + public boolean equals(@CheckForNull Object obj) { + if (obj instanceof Cut) { + // It might not really be a Cut, but we'll catch a CCE if it's not +@@ -372,8 +372,8 @@ abstract class Cut implements Comparable>, Serializ + return endpoint; + } + +- @Override + @CheckForNull ++ @Override + C greatestValueBelow(DiscreteDomain domain) { + return domain.previous(endpoint); + } +@@ -451,8 +451,8 @@ abstract class Cut implements Comparable>, Serializ + sb.append(endpoint).append(']'); + } + +- @Override + @CheckForNull ++ @Override + C leastValueAbove(DiscreteDomain domain) { + return domain.next(endpoint); + } +diff --git a/guava/src/com/google/common/collect/DenseImmutableTable.java b/guava/src/com/google/common/collect/DenseImmutableTable.java +index 563bd6ef5f..f67ef90e2d 100644 +--- a/guava/src/com/google/common/collect/DenseImmutableTable.java ++++ b/guava/src/com/google/common/collect/DenseImmutableTable.java +@@ -26,7 +26,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; + + /** A {@code RegularImmutableTable} optimized for dense data. */ + @GwtCompatible +-@Immutable(containerOf = {"R", "C", "V"}) ++@Immutable(containerOf = {"C", "R", "V"}) + @ElementTypesAreNonnullByDefault + final class DenseImmutableTable extends RegularImmutableTable { + private final ImmutableMap rowKeyToIndex; +@@ -117,8 +117,8 @@ final class DenseImmutableTable extends RegularImmutableTable + return size; + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + Integer keyIndex = keyToIndex().get(key); + return (keyIndex == null) ? null : getValue(keyIndex); +@@ -130,8 +130,8 @@ final class DenseImmutableTable extends RegularImmutableTable + private int index = -1; + private final int maxIndex = keyToIndex().size(); + +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + for (index++; index < maxIndex; index++) { + V value = getValue(index); +@@ -158,8 +158,8 @@ final class DenseImmutableTable extends RegularImmutableTable + return columnKeyToIndex; + } + +- @Override + @CheckForNull ++ @Override + V getValue(int keyIndex) { + return values[rowIndex][keyIndex]; + } +@@ -183,8 +183,8 @@ final class DenseImmutableTable extends RegularImmutableTable + return rowKeyToIndex; + } + +- @Override + @CheckForNull ++ @Override + V getValue(int keyIndex) { + return values[keyIndex][columnIndex]; + } +@@ -253,8 +253,8 @@ final class DenseImmutableTable extends RegularImmutableTable + return ImmutableMap.>copyOf(rowMap); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + Integer rowIndex = rowKeyToIndex.get(rowKey); + Integer columnIndex = columnKeyToIndex.get(columnKey); +diff --git a/guava/src/com/google/common/collect/DescendingImmutableSortedMultiset.java b/guava/src/com/google/common/collect/DescendingImmutableSortedMultiset.java +index 181731cc48..e5eaedbcbe 100644 +--- a/guava/src/com/google/common/collect/DescendingImmutableSortedMultiset.java ++++ b/guava/src/com/google/common/collect/DescendingImmutableSortedMultiset.java +@@ -37,14 +37,14 @@ final class DescendingImmutableSortedMultiset extends ImmutableSortedMultiset + return forward.count(element); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return forward.lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return forward.firstEntry(); + } +diff --git a/guava/src/com/google/common/collect/DescendingImmutableSortedSet.java b/guava/src/com/google/common/collect/DescendingImmutableSortedSet.java +index 88c7d6b5cc..0a9eefb847 100644 +--- a/guava/src/com/google/common/collect/DescendingImmutableSortedSet.java ++++ b/guava/src/com/google/common/collect/DescendingImmutableSortedSet.java +@@ -65,44 +65,44 @@ final class DescendingImmutableSortedSet extends ImmutableSortedSet { + return forward.headSet(fromElement, inclusive).descendingSet(); + } + +- @Override + @GwtIncompatible("NavigableSet") ++ @Override + public ImmutableSortedSet descendingSet() { + return forward; + } + +- @Override + @GwtIncompatible("NavigableSet") ++ @Override + public UnmodifiableIterator descendingIterator() { + return forward.iterator(); + } + +- @Override + @GwtIncompatible("NavigableSet") ++ @Override + ImmutableSortedSet createDescendingSet() { + throw new AssertionError("should never be called"); + } + +- @Override + @CheckForNull ++ @Override + public E lower(E element) { + return forward.higher(element); + } + +- @Override + @CheckForNull ++ @Override + public E floor(E element) { + return forward.ceiling(element); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(E element) { + return forward.floor(element); + } + +- @Override + @CheckForNull ++ @Override + public E higher(E element) { + return forward.lower(element); + } +diff --git a/guava/src/com/google/common/collect/DescendingMultiset.java b/guava/src/com/google/common/collect/DescendingMultiset.java +index 7db0fbbd49..8bfd959dce 100644 +--- a/guava/src/com/google/common/collect/DescendingMultiset.java ++++ b/guava/src/com/google/common/collect/DescendingMultiset.java +@@ -59,14 +59,14 @@ abstract class DescendingMultiset extends Forwarding + return result; + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return forwardMultiset().pollLastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return forwardMultiset().pollFirstEntry(); + } +@@ -102,14 +102,14 @@ abstract class DescendingMultiset extends Forwarding + return forwardMultiset(); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return forwardMultiset().lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return forwardMultiset().firstEntry(); + } +diff --git a/guava/src/com/google/common/collect/DiscreteDomain.java b/guava/src/com/google/common/collect/DiscreteDomain.java +index 222ebe5283..cffa9379eb 100644 +--- a/guava/src/com/google/common/collect/DiscreteDomain.java ++++ b/guava/src/com/google/common/collect/DiscreteDomain.java +@@ -63,15 +63,15 @@ public abstract class DiscreteDomain { + super(true); + } + +- @Override + @CheckForNull ++ @Override + public Integer next(Integer value) { + int i = value; + return (i == Integer.MAX_VALUE) ? null : i + 1; + } + +- @Override + @CheckForNull ++ @Override + public Integer previous(Integer value) { + int i = value; + return (i == Integer.MIN_VALUE) ? null : i - 1; +@@ -126,15 +126,15 @@ public abstract class DiscreteDomain { + super(true); + } + +- @Override + @CheckForNull ++ @Override + public Long next(Long value) { + long l = value; + return (l == Long.MAX_VALUE) ? null : l + 1; + } + +- @Override + @CheckForNull ++ @Override + public Long previous(Long value) { + long l = value; + return (l == Long.MIN_VALUE) ? null : l - 1; +diff --git a/guava/src/com/google/common/collect/EnumBiMap.java b/guava/src/com/google/common/collect/EnumBiMap.java +index 97d3c2e7cd..d2f9921f2a 100644 +--- a/guava/src/com/google/common/collect/EnumBiMap.java ++++ b/guava/src/com/google/common/collect/EnumBiMap.java +@@ -126,8 +126,8 @@ public final class EnumBiMap, V extends Enum> extends Abstr + Serialization.writeMap(this, stream); + } + +- @SuppressWarnings("unchecked") // reading fields populated by writeObject +- @GwtIncompatible // java.io.ObjectInputStream ++ @GwtIncompatible // reading fields populated by writeObject ++ @SuppressWarnings("unchecked") // java.io.ObjectInputStream + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + keyType = (Class) stream.readObject(); +diff --git a/guava/src/com/google/common/collect/EnumHashBiMap.java b/guava/src/com/google/common/collect/EnumHashBiMap.java +index 5fbbb70c63..d62550cca2 100644 +--- a/guava/src/com/google/common/collect/EnumHashBiMap.java ++++ b/guava/src/com/google/common/collect/EnumHashBiMap.java +@@ -89,19 +89,19 @@ public final class EnumHashBiMap, V extends @Nullable Object> + } + + @CanIgnoreReturnValue +- @Override +- @SuppressWarnings("RedundantOverride") // b/192446478: RedundantOverride ignores some annotations. +- // TODO(b/192446998): Remove this override after tools understand nullness better. + @CheckForNull ++ @Override // b/192446478: RedundantOverride ignores some annotations. ++ // TODO(b/192446998): Remove this override after tools understand nullness better. ++ @SuppressWarnings("RedundantOverride") + public V put(K key, @ParametricNullness V value) { + return super.put(key, value); + } + + @CanIgnoreReturnValue +- @Override +- @SuppressWarnings("RedundantOverride") // b/192446478: RedundantOverride ignores some annotations. +- // TODO(b/192446998): Remove this override after tools understand nullness better. + @CheckForNull ++ @Override // b/192446478: RedundantOverride ignores some annotations. ++ // TODO(b/192446998): Remove this override after tools understand nullness better. ++ @SuppressWarnings("RedundantOverride") + public V forcePut(K key, @ParametricNullness V value) { + return super.forcePut(key, value); + } +@@ -122,8 +122,8 @@ public final class EnumHashBiMap, V extends @Nullable Object> + Serialization.writeMap(this, stream); + } + +- @SuppressWarnings("unchecked") // reading field populated by writeObject +- @GwtIncompatible // java.io.ObjectInputStream ++ @GwtIncompatible // reading field populated by writeObject ++ @SuppressWarnings("unchecked") // java.io.ObjectInputStream + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + keyType = (Class) stream.readObject(); +diff --git a/guava/src/com/google/common/collect/EvictingQueue.java b/guava/src/com/google/common/collect/EvictingQueue.java +index 5667dfa8c0..8a06c46ad3 100644 +--- a/guava/src/com/google/common/collect/EvictingQueue.java ++++ b/guava/src/com/google/common/collect/EvictingQueue.java +@@ -89,8 +89,8 @@ public final class EvictingQueue extends ForwardingQueue implements Serial + * + * @return {@code true} always + */ +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean offer(E e) { + return add(e); + } +@@ -101,8 +101,8 @@ public final class EvictingQueue extends ForwardingQueue implements Serial + * + * @return {@code true} always + */ +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean add(E e) { + checkNotNull(e); // check before removing + if (maxSize == 0) { +@@ -115,8 +115,8 @@ public final class EvictingQueue extends ForwardingQueue implements Serial + return true; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean addAll(Collection collection) { + int size = collection.size(); + if (size >= maxSize) { +diff --git a/guava/src/com/google/common/collect/FilteredEntryMultimap.java b/guava/src/com/google/common/collect/FilteredEntryMultimap.java +index de946a215f..05f0d66f43 100644 +--- a/guava/src/com/google/common/collect/FilteredEntryMultimap.java ++++ b/guava/src/com/google/common/collect/FilteredEntryMultimap.java +@@ -20,6 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Predicates.in; + import static com.google.common.base.Predicates.not; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; ++import static java.util.Collections.unmodifiableList; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.base.MoreObjects; +@@ -178,8 +180,8 @@ class FilteredEntryMultimap get(@CheckForNull Object key) { + Collection result = unfiltered.asMap().get(key); + if (result == null) { +@@ -191,8 +193,8 @@ class FilteredEntryMultimap remove(@CheckForNull Object key) { + Collection collection = unfiltered.asMap().get(key); + if (collection == null) { +@@ -212,9 +214,9 @@ class FilteredEntryMultimap>> backingIterator = + unfiltered.asMap().entrySet().iterator(); + +- @Override + @CheckForNull ++ @Override + protected Entry> computeNext() { + while (backingIterator.hasNext()) { + Entry> entry = backingIterator.next(); +diff --git a/guava/src/com/google/common/collect/FilteredKeyMultimap.java b/guava/src/com/google/common/collect/FilteredKeyMultimap.java +index 68fad75b14..8b699d48ba 100644 +--- a/guava/src/com/google/common/collect/FilteredKeyMultimap.java ++++ b/guava/src/com/google/common/collect/FilteredKeyMultimap.java +@@ -24,7 +24,6 @@ import com.google.common.base.Predicate; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.j2objc.annotations.WeakOuter; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; + import java.util.Map; +@@ -134,7 +133,7 @@ class FilteredKeyMultimap delegate() { +- return Collections.emptySet(); ++ return emptySet(); + } + } + +@@ -174,7 +173,7 @@ class FilteredKeyMultimap delegate() { +- return Collections.emptyList(); ++ return emptyList(); + } + } + +diff --git a/guava/src/com/google/common/collect/FilteredMultimapValues.java b/guava/src/com/google/common/collect/FilteredMultimapValues.java +index ecbfab2a1d..121f2311ed 100644 +--- a/guava/src/com/google/common/collect/FilteredMultimapValues.java ++++ b/guava/src/com/google/common/collect/FilteredMultimapValues.java +@@ -15,6 +15,8 @@ + package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Predicates.in; ++import static com.google.common.base.Predicates.not; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.base.Objects; +@@ -78,7 +80,7 @@ final class FilteredMultimapValues> is required to build with JDK6 + Predicates.>and( +- multimap.entryPredicate(), Maps.valuePredicateOnEntries(Predicates.in(c)))); ++ multimap.entryPredicate(), Maps.valuePredicateOnEntries(in(c)))); + } + + @Override +@@ -87,8 +89,7 @@ final class FilteredMultimapValues> is required to build with JDK6 + Predicates.>and( +- multimap.entryPredicate(), +- Maps.valuePredicateOnEntries(Predicates.not(Predicates.in(c))))); ++ multimap.entryPredicate(), Maps.valuePredicateOnEntries(not(in(c))))); + } + + @Override +diff --git a/guava/src/com/google/common/collect/FluentIterable.java b/guava/src/com/google/common/collect/FluentIterable.java +index 11bda3bde9..fee20a7ce7 100644 +--- a/guava/src/com/google/common/collect/FluentIterable.java ++++ b/guava/src/com/google/common/collect/FluentIterable.java +@@ -175,7 +175,7 @@ public abstract class FluentIterable implements Iter + @Deprecated + @InlineMe( + replacement = "checkNotNull(iterable)", +- staticImports = {"com.google.common.base.Preconditions.checkNotNull"}) ++ staticImports = "com.google.common.base.Preconditions.checkNotNull") + public static FluentIterable from(FluentIterable iterable) { + return checkNotNull(iterable); + } +diff --git a/guava/src/com/google/common/collect/ForwardingBlockingDeque.java b/guava/src/com/google/common/collect/ForwardingBlockingDeque.java +index 49d4bcf6c2..314e487787 100644 +--- a/guava/src/com/google/common/collect/ForwardingBlockingDeque.java ++++ b/guava/src/com/google/common/collect/ForwardingBlockingDeque.java +@@ -92,14 +92,14 @@ public abstract class ForwardingBlockingDeque extends ForwardingDeque + return delegate().takeLast(); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().pollFirst(timeout, unit); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().pollLast(timeout, unit); + } +@@ -119,8 +119,8 @@ public abstract class ForwardingBlockingDeque extends ForwardingDeque + return delegate().take(); + } + +- @Override + @CheckForNull ++ @Override + public E poll(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().poll(timeout, unit); + } +diff --git a/guava/src/com/google/common/collect/ForwardingConcurrentMap.java b/guava/src/com/google/common/collect/ForwardingConcurrentMap.java +index b662b0774a..fdeb097e02 100644 +--- a/guava/src/com/google/common/collect/ForwardingConcurrentMap.java ++++ b/guava/src/com/google/common/collect/ForwardingConcurrentMap.java +@@ -48,8 +48,8 @@ public abstract class ForwardingConcurrentMap extends ForwardingMap + protected abstract ConcurrentMap delegate(); + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V putIfAbsent(K key, V value) { + return delegate().putIfAbsent(key, value); + } +@@ -61,8 +61,8 @@ public abstract class ForwardingConcurrentMap extends ForwardingMap + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V replace(K key, V value) { + return delegate().replace(key, value); + } +diff --git a/guava/src/com/google/common/collect/ForwardingDeque.java b/guava/src/com/google/common/collect/ForwardingDeque.java +index 571535cab9..8abe48892e 100644 +--- a/guava/src/com/google/common/collect/ForwardingDeque.java ++++ b/guava/src/com/google/common/collect/ForwardingDeque.java +@@ -90,28 +90,28 @@ public abstract class ForwardingDeque extends Forwar + return delegate().offerLast(e); + } + +- @Override + @CheckForNull ++ @Override + public E peekFirst() { + return delegate().peekFirst(); + } + +- @Override + @CheckForNull ++ @Override + public E peekLast() { + return delegate().peekLast(); + } + + @CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + return delegate().pollFirst(); + } + + @CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? +- @Override + @CheckForNull ++ @Override + public E pollLast() { + return delegate().pollLast(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingMap.java b/guava/src/com/google/common/collect/ForwardingMap.java +index 315a4fabca..a7b6936e01 100644 +--- a/guava/src/com/google/common/collect/ForwardingMap.java ++++ b/guava/src/com/google/common/collect/ForwardingMap.java +@@ -78,8 +78,8 @@ public abstract class ForwardingMap delegate(); + +- @Override + @CheckForNull ++ @Override + public Entry lowerEntry(@ParametricNullness K key) { + return delegate().lowerEntry(key); + } +@@ -82,8 +82,8 @@ public abstract class ForwardingNavigableMap floorEntry(@ParametricNullness K key) { + return delegate().floorEntry(key); + } +@@ -114,8 +114,8 @@ public abstract class ForwardingNavigableMap ceilingEntry(@ParametricNullness K key) { + return delegate().ceilingEntry(key); + } +@@ -146,8 +146,8 @@ public abstract class ForwardingNavigableMap higherEntry(@ParametricNullness K key) { + return delegate().higherEntry(key); + } +@@ -178,8 +178,8 @@ public abstract class ForwardingNavigableMap firstEntry() { + return delegate().firstEntry(); + } +@@ -224,8 +224,8 @@ public abstract class ForwardingNavigableMap lastEntry() { + return delegate().lastEntry(); + } +@@ -253,8 +253,8 @@ public abstract class ForwardingNavigableMap pollFirstEntry() { + return delegate().pollFirstEntry(); + } +@@ -269,8 +269,8 @@ public abstract class ForwardingNavigableMap pollLastEntry() { + return delegate().pollLastEntry(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingNavigableSet.java b/guava/src/com/google/common/collect/ForwardingNavigableSet.java +index 6822aa87d4..c8f509ddbb 100644 +--- a/guava/src/com/google/common/collect/ForwardingNavigableSet.java ++++ b/guava/src/com/google/common/collect/ForwardingNavigableSet.java +@@ -61,8 +61,8 @@ public abstract class ForwardingNavigableSet + @Override + protected abstract NavigableSet delegate(); + +- @Override + @CheckForNull ++ @Override + public E lower(@ParametricNullness E e) { + return delegate().lower(e); + } +@@ -77,8 +77,8 @@ public abstract class ForwardingNavigableSet + return Iterators.getNext(headSet(e, false).descendingIterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public E floor(@ParametricNullness E e) { + return delegate().floor(e); + } +@@ -93,8 +93,8 @@ public abstract class ForwardingNavigableSet + return Iterators.getNext(headSet(e, true).descendingIterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(@ParametricNullness E e) { + return delegate().ceiling(e); + } +@@ -109,8 +109,8 @@ public abstract class ForwardingNavigableSet + return Iterators.getNext(tailSet(e, true).iterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public E higher(@ParametricNullness E e) { + return delegate().higher(e); + } +@@ -125,8 +125,8 @@ public abstract class ForwardingNavigableSet + return Iterators.getNext(tailSet(e, false).iterator(), null); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + return delegate().pollFirst(); + } +@@ -141,8 +141,8 @@ public abstract class ForwardingNavigableSet + return Iterators.pollNext(iterator()); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + return delegate().pollLast(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingQueue.java b/guava/src/com/google/common/collect/ForwardingQueue.java +index 43c2eaafb5..47c5caf393 100644 +--- a/guava/src/com/google/common/collect/ForwardingQueue.java ++++ b/guava/src/com/google/common/collect/ForwardingQueue.java +@@ -63,8 +63,8 @@ public abstract class ForwardingQueue extends Forwar + } + + @CanIgnoreReturnValue // TODO(cpovirk): Consider removing this? +- @Override + @CheckForNull ++ @Override + public E poll() { + return delegate().poll(); + } +@@ -76,8 +76,8 @@ public abstract class ForwardingQueue extends Forwar + return delegate().remove(); + } + +- @Override + @CheckForNull ++ @Override + public E peek() { + return delegate().peek(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingSortedMap.java b/guava/src/com/google/common/collect/ForwardingSortedMap.java +index e0882abc7a..9f8e64c3c3 100644 +--- a/guava/src/com/google/common/collect/ForwardingSortedMap.java ++++ b/guava/src/com/google/common/collect/ForwardingSortedMap.java +@@ -63,8 +63,8 @@ public abstract class ForwardingSortedMap delegate(); + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return delegate().comparator(); + } +@@ -112,7 +112,7 @@ public abstract class ForwardingSortedMap comparator, @CheckForNull Object o1, @CheckForNull Object o2) { + if (comparator == null) { +@@ -129,12 +129,12 @@ public abstract class ForwardingSortedMap self = (SortedMap<@Nullable Object, V>) this; + Object ceilingKey = self.tailMap(key).firstKey(); + return unsafeCompare(comparator(), ceilingKey, key) == 0; +diff --git a/guava/src/com/google/common/collect/ForwardingSortedMultiset.java b/guava/src/com/google/common/collect/ForwardingSortedMultiset.java +index 4626d3193a..e7e82b560d 100644 +--- a/guava/src/com/google/common/collect/ForwardingSortedMultiset.java ++++ b/guava/src/com/google/common/collect/ForwardingSortedMultiset.java +@@ -112,8 +112,8 @@ public abstract class ForwardingSortedMultiset + } + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return delegate().firstEntry(); + } +@@ -134,8 +134,8 @@ public abstract class ForwardingSortedMultiset + return Multisets.immutableEntry(entry.getElement(), entry.getCount()); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return delegate().lastEntry(); + } +@@ -157,8 +157,8 @@ public abstract class ForwardingSortedMultiset + return Multisets.immutableEntry(entry.getElement(), entry.getCount()); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return delegate().pollFirstEntry(); + } +@@ -181,8 +181,8 @@ public abstract class ForwardingSortedMultiset + return entry; + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return delegate().pollLastEntry(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingSortedSet.java b/guava/src/com/google/common/collect/ForwardingSortedSet.java +index 32625afd16..d5695a3788 100644 +--- a/guava/src/com/google/common/collect/ForwardingSortedSet.java ++++ b/guava/src/com/google/common/collect/ForwardingSortedSet.java +@@ -65,8 +65,8 @@ public abstract class ForwardingSortedSet extends Fo + @Override + protected abstract SortedSet delegate(); + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return delegate().comparator(); + } +@@ -105,12 +105,12 @@ public abstract class ForwardingSortedSet extends Fo + * + * @since 7.0 + */ +- @Override + @Beta ++ @Override + protected boolean standardContains(@CheckForNull Object object) { + try { + // any ClassCastExceptions and NullPointerExceptions are caught +- @SuppressWarnings({"unchecked", "nullness"}) ++ @SuppressWarnings({"nullness", "unchecked"}) + SortedSet<@Nullable Object> self = (SortedSet<@Nullable Object>) this; + Object ceiling = self.tailSet(object).first(); + return unsafeCompare(comparator(), ceiling, object) == 0; +@@ -126,12 +126,12 @@ public abstract class ForwardingSortedSet extends Fo + * + * @since 7.0 + */ +- @Override + @Beta ++ @Override + protected boolean standardRemove(@CheckForNull Object object) { + try { + // any ClassCastExceptions and NullPointerExceptions are caught +- @SuppressWarnings({"unchecked", "nullness"}) ++ @SuppressWarnings({"nullness", "unchecked"}) + SortedSet<@Nullable Object> self = (SortedSet<@Nullable Object>) this; + Iterator iterator = self.tailSet(object).iterator(); + if (iterator.hasNext()) { +diff --git a/guava/src/com/google/common/collect/ForwardingSortedSetMultimap.java b/guava/src/com/google/common/collect/ForwardingSortedSetMultimap.java +index b91a68b344..05d64a8742 100644 +--- a/guava/src/com/google/common/collect/ForwardingSortedSetMultimap.java ++++ b/guava/src/com/google/common/collect/ForwardingSortedSetMultimap.java +@@ -61,8 +61,8 @@ public abstract class ForwardingSortedSetMultimap< + return delegate().replaceValues(key, values); + } + +- @Override + @CheckForNull ++ @Override + public Comparator valueComparator() { + return delegate().valueComparator(); + } +diff --git a/guava/src/com/google/common/collect/ForwardingTable.java b/guava/src/com/google/common/collect/ForwardingTable.java +index 4fcb858b72..adf7be43b6 100644 +--- a/guava/src/com/google/common/collect/ForwardingTable.java ++++ b/guava/src/com/google/common/collect/ForwardingTable.java +@@ -88,8 +88,8 @@ public abstract class ForwardingTable< + return delegate().containsValue(value); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return delegate().get(rowKey, columnKey); + } +@@ -100,8 +100,8 @@ public abstract class ForwardingTable< + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V put( + @ParametricNullness R rowKey, @ParametricNullness C columnKey, @ParametricNullness V value) { + return delegate().put(rowKey, columnKey, value); +@@ -113,8 +113,8 @@ public abstract class ForwardingTable< + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return delegate().remove(rowKey, columnKey); + } +diff --git a/guava/src/com/google/common/collect/HashBiMap.java b/guava/src/com/google/common/collect/HashBiMap.java +index b0a5dd50ed..1ffffe8687 100644 +--- a/guava/src/com/google/common/collect/HashBiMap.java ++++ b/guava/src/com/google/common/collect/HashBiMap.java +@@ -277,15 +277,15 @@ public final class HashBiMap[] createTable(int length) { + return new @Nullable BiEntry[length]; + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + BiEntry entry = seekByKey(key, smearedHash(key)); + if (entry == null) { +@@ -616,27 +616,27 @@ public final class HashBiMap entry = seekByValue(value, smearedHash(value)); + if (entry == null) { +diff --git a/guava/src/com/google/common/collect/HashMultimap.java b/guava/src/com/google/common/collect/HashMultimap.java +index 9e4c1c2233..ff604b807f 100644 +--- a/guava/src/com/google/common/collect/HashMultimap.java ++++ b/guava/src/com/google/common/collect/HashMultimap.java +@@ -16,10 +16,11 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.annotations.VisibleForTesting; +-import com.google.common.base.Preconditions; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; +@@ -105,7 +106,7 @@ public final class HashMultimap>newHashMapWithExpectedSize(expectedKeys)); +- Preconditions.checkArgument(expectedValuesPerKey >= 0); ++ checkArgument(expectedValuesPerKey >= 0); + this.expectedValuesPerKey = expectedValuesPerKey; + } + +diff --git a/guava/src/com/google/common/collect/ImmutableBiMap.java b/guava/src/com/google/common/collect/ImmutableBiMap.java +index 4c222c1bf9..5a7fc393d8 100644 +--- a/guava/src/com/google/common/collect/ImmutableBiMap.java ++++ b/guava/src/com/google/common/collect/ImmutableBiMap.java +@@ -390,8 +390,8 @@ public abstract class ImmutableBiMap extends ImmutableBiMapFauxverideShim< + * @throws NullPointerException if any key, value, or entry is null + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + @Override + public Builder putAll(Iterable> entries) { + super.putAll(entries); +@@ -408,16 +408,16 @@ public abstract class ImmutableBiMap extends ImmutableBiMapFauxverideShim< + * @throws IllegalStateException if this method was already called + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + @Override + public Builder orderEntriesByValue(Comparator valueComparator) { + super.orderEntriesByValue(valueComparator); + return this; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + Builder combine(ImmutableMap.Builder builder) { + super.combine(builder); + return this; +@@ -488,8 +488,8 @@ public abstract class ImmutableBiMap extends ImmutableBiMapFauxverideShim< + * @deprecated This method does not make sense for bimaps and should not be called. + * @since 31.1 + */ +- @DoNotCall + @Deprecated ++ @DoNotCall + @Override + public ImmutableBiMap buildKeepingLast() { + throw new UnsupportedOperationException("Not supported for bimaps"); +@@ -604,10 +604,10 @@ public abstract class ImmutableBiMap extends ImmutableBiMapFauxverideShim< + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V forcePut(K key, V value) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java b/guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java +index c59e9fdaba..48eb0f55c3 100644 +--- a/guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java ++++ b/guava/src/com/google/common/collect/ImmutableClassToInstanceMap.java +@@ -172,9 +172,9 @@ public final class ImmutableClassToInstanceMap extends ForwardingMap T getInstance(Class type) { + return (T) delegate.get(checkNotNull(type)); + } +@@ -186,10 +186,10 @@ public final class ImmutableClassToInstanceMap extends ForwardingMap T putInstance(Class type, T value) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableCollection.java b/guava/src/com/google/common/collect/ImmutableCollection.java +index 314f83cce9..c432e5e1e4 100644 +--- a/guava/src/com/google/common/collect/ImmutableCollection.java ++++ b/guava/src/com/google/common/collect/ImmutableCollection.java +@@ -258,8 +258,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean add(E e) { + throw new UnsupportedOperationException(); + } +@@ -272,8 +272,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean remove(@CheckForNull Object object) { + throw new UnsupportedOperationException(); + } +@@ -286,8 +286,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean addAll(Collection newElements) { + throw new UnsupportedOperationException(); + } +@@ -300,8 +300,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean removeAll(Collection oldElements) { + throw new UnsupportedOperationException(); + } +@@ -314,8 +314,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean removeIf(Predicate filter) { + throw new UnsupportedOperationException(); + } +@@ -327,8 +327,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean retainAll(Collection elementsToKeep) { + throw new UnsupportedOperationException(); + } +@@ -340,8 +340,8 @@ public abstract class ImmutableCollection extends AbstractCollection imple + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void clear() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableEnumMap.java b/guava/src/com/google/common/collect/ImmutableEnumMap.java +index d1e10f97d0..b932253cb7 100644 +--- a/guava/src/com/google/common/collect/ImmutableEnumMap.java ++++ b/guava/src/com/google/common/collect/ImmutableEnumMap.java +@@ -74,8 +74,8 @@ final class ImmutableEnumMap, V> extends IteratorBasedImmutabl + return delegate.containsKey(key); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return delegate.get(key); + } +diff --git a/guava/src/com/google/common/collect/ImmutableList.java b/guava/src/com/google/common/collect/ImmutableList.java +index bc8166507d..e92d454e28 100644 +--- a/guava/src/com/google/common/collect/ImmutableList.java ++++ b/guava/src/com/google/common/collect/ImmutableList.java +@@ -508,8 +508,8 @@ public abstract class ImmutableList extends ImmutableCollection + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean addAll(int index, Collection newElements) { + throw new UnsupportedOperationException(); + } +@@ -522,8 +522,8 @@ public abstract class ImmutableList extends ImmutableCollection + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final E set(int index, E element) { + throw new UnsupportedOperationException(); + } +@@ -535,8 +535,8 @@ public abstract class ImmutableList extends ImmutableCollection + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void add(int index, E element) { + throw new UnsupportedOperationException(); + } +@@ -549,8 +549,8 @@ public abstract class ImmutableList extends ImmutableCollection + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final E remove(int index) { + throw new UnsupportedOperationException(); + } +@@ -562,8 +562,8 @@ public abstract class ImmutableList extends ImmutableCollection + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void replaceAll(UnaryOperator operator) { + throw new UnsupportedOperationException(); + } +@@ -575,8 +575,8 @@ public abstract class ImmutableList extends ImmutableCollection + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void sort(Comparator c) { + throw new UnsupportedOperationException(); + } +@@ -587,8 +587,8 @@ public abstract class ImmutableList extends ImmutableCollection + * @since 2.0 + * @deprecated There is no reason to use this; it always returns {@code this}. + */ +- @InlineMe(replacement = "this") + @Deprecated ++ @InlineMe(replacement = "this") + @Override + public final ImmutableList asList() { + return this; +diff --git a/guava/src/com/google/common/collect/ImmutableListMultimap.java b/guava/src/com/google/common/collect/ImmutableListMultimap.java +index 1acc1fc841..20916430e4 100644 +--- a/guava/src/com/google/common/collect/ImmutableListMultimap.java ++++ b/guava/src/com/google/common/collect/ImmutableListMultimap.java +@@ -242,8 +242,8 @@ public class ImmutableListMultimap extends ImmutableMultimap + * + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + @Override + public Builder putAll(Iterable> entries) { + super.putAll(entries); +@@ -432,8 +432,8 @@ public class ImmutableListMultimap extends ImmutableMultimap + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final ImmutableList removeAll(@CheckForNull Object key) { + throw new UnsupportedOperationException(); + } +@@ -446,8 +446,8 @@ public class ImmutableListMultimap extends ImmutableMultimap + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final ImmutableList replaceValues(K key, Iterable values) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableMap.java b/guava/src/com/google/common/collect/ImmutableMap.java +index b24ed6c732..9ba5e20d55 100644 +--- a/guava/src/com/google/common/collect/ImmutableMap.java ++++ b/guava/src/com/google/common/collect/ImmutableMap.java +@@ -422,7 +422,7 @@ public abstract class ImmutableMap implements Map, Serializable { + this(ImmutableCollection.Builder.DEFAULT_INITIAL_CAPACITY); + } + +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + Builder(int initialCapacity) { + this.entries = new @Nullable Entry[initialCapacity]; + this.size = 0; +@@ -484,8 +484,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @throws NullPointerException if any key, value, or entry is null + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + public Builder putAll(Iterable> entries) { + if (entries instanceof Collection) { + ensureCapacity(size + ((Collection) entries).size()); +@@ -506,8 +506,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @throws IllegalStateException if this method was already called + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + public Builder orderEntriesByValue(Comparator valueComparator) { + checkState(this.valueComparator == null, "valueComparator was already set"); + this.valueComparator = checkNotNull(valueComparator, "valueComparator"); +@@ -772,10 +772,10 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V put(K k, V v) { + throw new UnsupportedOperationException(); + } +@@ -787,10 +787,10 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V putIfAbsent(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -802,8 +802,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean replace(K key, V oldValue, V newValue) { + throw new UnsupportedOperationException(); + } +@@ -814,10 +814,10 @@ public abstract class ImmutableMap implements Map, Serializable { + * @throws UnsupportedOperationException always + * @deprecated Unsupported operation. + */ +- @Deprecated +- @Override + @CheckForNull ++ @Deprecated + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final V replace(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -829,8 +829,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final V computeIfAbsent(K key, Function mappingFunction) { + throw new UnsupportedOperationException(); + } +@@ -842,8 +842,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final V computeIfPresent( + K key, BiFunction remappingFunction) { + throw new UnsupportedOperationException(); +@@ -856,8 +856,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final V compute( + K key, BiFunction remappingFunction) { + throw new UnsupportedOperationException(); +@@ -870,8 +870,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final V merge( + K key, V value, BiFunction remappingFunction) { + throw new UnsupportedOperationException(); +@@ -884,8 +884,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void putAll(Map map) { + throw new UnsupportedOperationException(); + } +@@ -897,8 +897,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void replaceAll(BiFunction function) { + throw new UnsupportedOperationException(); + } +@@ -909,10 +909,10 @@ public abstract class ImmutableMap implements Map, Serializable { + * @throws UnsupportedOperationException always + * @deprecated Unsupported operation. + */ ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V remove(@CheckForNull Object o) { + throw new UnsupportedOperationException(); + } +@@ -924,8 +924,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean remove(@CheckForNull Object key, @CheckForNull Object value) { + throw new UnsupportedOperationException(); + } +@@ -937,8 +937,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void clear() { + throw new UnsupportedOperationException(); + } +@@ -959,8 +959,8 @@ public abstract class ImmutableMap implements Map, Serializable { + } + + // Overriding to mark it Nullable +- @Override + @CheckForNull ++ @Override + public abstract V get(@CheckForNull Object key); + + /** +@@ -968,8 +968,8 @@ public abstract class ImmutableMap implements Map, Serializable { + * href="https://github.com/google/guava#guava-google-core-libraries-for-java">flavor). + * Note, however, that Java 8 users can call this method with any version and flavor of Guava. + */ +- @Override + @CheckForNull ++ @Override + public final V getOrDefault(@CheckForNull Object key, @CheckForNull V defaultValue) { + /* + * Even though it's weird to pass a defaultValue that is null, some callers do so. Those who +@@ -1114,8 +1114,8 @@ public abstract class ImmutableMap implements Map, Serializable { + return ImmutableMap.this.containsKey(key); + } + +- @Override + @CheckForNull ++ @Override + public ImmutableSet get(@CheckForNull Object key) { + V outerValue = ImmutableMap.this.get(key); + return (outerValue == null) ? null : ImmutableSet.of(outerValue); +diff --git a/guava/src/com/google/common/collect/ImmutableMapEntry.java b/guava/src/com/google/common/collect/ImmutableMapEntry.java +index ac483d8fd8..13b5262a9d 100644 +--- a/guava/src/com/google/common/collect/ImmutableMapEntry.java ++++ b/guava/src/com/google/common/collect/ImmutableMapEntry.java +@@ -92,8 +92,8 @@ class ImmutableMapEntry extends ImmutableEntry { + this.nextInKeyBucket = nextInKeyBucket; + } + +- @Override + @CheckForNull ++ @Override + final ImmutableMapEntry getNextInKeyBucket() { + return nextInKeyBucket; + } +@@ -117,8 +117,8 @@ class ImmutableMapEntry extends ImmutableEntry { + this.nextInValueBucket = nextInValueBucket; + } + +- @Override + @CheckForNull ++ @Override + ImmutableMapEntry getNextInValueBucket() { + return nextInValueBucket; + } +diff --git a/guava/src/com/google/common/collect/ImmutableMapEntrySet.java b/guava/src/com/google/common/collect/ImmutableMapEntrySet.java +index 6f5503af5c..b0fd79672c 100644 +--- a/guava/src/com/google/common/collect/ImmutableMapEntrySet.java ++++ b/guava/src/com/google/common/collect/ImmutableMapEntrySet.java +@@ -52,8 +52,8 @@ abstract class ImmutableMapEntrySet extends ImmutableSet.CachingAsList extends ImmutableSet.CachingAsList extends BaseImmutableMultimap putAll(Iterable> entries) { + for (Entry entry : entries) { + put(entry); +@@ -366,8 +366,8 @@ public abstract class ImmutableMultimap extends BaseImmutableMultimap extends BaseImmutableMultimap extends BaseImmutableMultimap extends BaseImmutableMultimap extends BaseImmutableMultimap values) { + throw new UnsupportedOperationException(); + } +@@ -457,8 +457,8 @@ public abstract class ImmutableMultimap extends BaseImmutableMultimap multimap) { + throw new UnsupportedOperationException(); + } +@@ -471,8 +471,8 @@ public abstract class ImmutableMultimap extends BaseImmutableMultimap extends ImmutableMultisetGwtSerializa + * @since 21.0 + */ + public static Collector> toImmutableMultiset() { +- return CollectCollectors.toImmutableMultiset(Function.identity(), e -> 1); ++ return CollectCollectors.toImmutableMultiset(identity(), e -> 1); + } + + /** +@@ -275,8 +276,8 @@ public abstract class ImmutableMultiset extends ImmutableMultisetGwtSerializa + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final int add(E element, int occurrences) { + throw new UnsupportedOperationException(); + } +@@ -289,8 +290,8 @@ public abstract class ImmutableMultiset extends ImmutableMultisetGwtSerializa + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final int remove(@CheckForNull Object element, int occurrences) { + throw new UnsupportedOperationException(); + } +@@ -303,8 +304,8 @@ public abstract class ImmutableMultiset extends ImmutableMultisetGwtSerializa + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final int setCount(E element, int count) { + throw new UnsupportedOperationException(); + } +@@ -317,8 +318,8 @@ public abstract class ImmutableMultiset extends ImmutableMultisetGwtSerializa + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean setCount(E element, int oldCount, int newCount) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableRangeMap.java b/guava/src/com/google/common/collect/ImmutableRangeMap.java +index e1979ab65f..06255a7aae 100644 +--- a/guava/src/com/google/common/collect/ImmutableRangeMap.java ++++ b/guava/src/com/google/common/collect/ImmutableRangeMap.java +@@ -177,8 +177,8 @@ public class ImmutableRangeMap, V> implements RangeMap, V> implements RangeMap, V> getEntry(K key) { + int index = + SortedLists.binarySearch( +@@ -230,8 +230,8 @@ public class ImmutableRangeMap, V> implements RangeMap range, V value) { + throw new UnsupportedOperationException(); + } +@@ -243,8 +243,8 @@ public class ImmutableRangeMap, V> implements RangeMap range, V value) { + throw new UnsupportedOperationException(); + } +@@ -256,8 +256,8 @@ public class ImmutableRangeMap, V> implements RangeMap rangeMap) { + throw new UnsupportedOperationException(); + } +@@ -269,8 +269,8 @@ public class ImmutableRangeMap, V> implements RangeMap, V> implements RangeMap range) { + throw new UnsupportedOperationException(); + } +@@ -295,8 +295,8 @@ public class ImmutableRangeMap, V> implements RangeMap range, + @CheckForNull V value, +diff --git a/guava/src/com/google/common/collect/ImmutableRangeSet.java b/guava/src/com/google/common/collect/ImmutableRangeSet.java +index f279aae0c5..8b4397d447 100644 +--- a/guava/src/com/google/common/collect/ImmutableRangeSet.java ++++ b/guava/src/com/google/common/collect/ImmutableRangeSet.java +@@ -187,8 +187,8 @@ public final class ImmutableRangeSet extends AbstractRange + return index != -1 && ranges.get(index).encloses(otherRange); + } + +- @Override + @CheckForNull ++ @Override + public Range rangeContaining(C value) { + int index = + SortedLists.binarySearch( +@@ -225,8 +225,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void add(Range range) { + throw new UnsupportedOperationException(); + } +@@ -238,8 +238,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void addAll(RangeSet other) { + throw new UnsupportedOperationException(); + } +@@ -251,8 +251,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void addAll(Iterable> other) { + throw new UnsupportedOperationException(); + } +@@ -264,8 +264,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void remove(Range range) { + throw new UnsupportedOperationException(); + } +@@ -277,8 +277,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void removeAll(RangeSet other) { + throw new UnsupportedOperationException(); + } +@@ -290,8 +290,8 @@ public final class ImmutableRangeSet extends AbstractRange + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public void removeAll(Iterable> other) { + throw new UnsupportedOperationException(); + } +@@ -579,8 +579,8 @@ public final class ImmutableRangeSet extends AbstractRange + final Iterator> rangeItr = ranges.iterator(); + Iterator elemItr = Iterators.emptyIterator(); + +- @Override + @CheckForNull ++ @Override + protected C computeNext() { + while (!elemItr.hasNext()) { + if (rangeItr.hasNext()) { +@@ -594,15 +594,15 @@ public final class ImmutableRangeSet extends AbstractRange + }; + } + +- @Override + @GwtIncompatible("NavigableSet") ++ @Override + public UnmodifiableIterator descendingIterator() { + return new AbstractIterator() { + final Iterator> rangeItr = ranges.reverse().iterator(); + Iterator elemItr = Iterators.emptyIterator(); + +- @Override + @CheckForNull ++ @Override + protected C computeNext() { + while (!elemItr.hasNext()) { + if (rangeItr.hasNext()) { +diff --git a/guava/src/com/google/common/collect/ImmutableSet.java b/guava/src/com/google/common/collect/ImmutableSet.java +index 73d5b09bf2..1cf249b5c3 100644 +--- a/guava/src/com/google/common/collect/ImmutableSet.java ++++ b/guava/src/com/google/common/collect/ImmutableSet.java +@@ -75,7 +75,7 @@ public abstract class ImmutableSet extends ImmutableCollection implements + * + *

Performance note: the instance returned is a singleton. + */ +- @SuppressWarnings({"unchecked"}) // fully variant implementation (never actually produces any Es) ++ @SuppressWarnings("unchecked") // fully variant implementation (never actually produces any Es) + public static ImmutableSet of() { + return (ImmutableSet) RegularImmutableSet.EMPTY; + } +@@ -510,8 +510,8 @@ public abstract class ImmutableSet extends ImmutableCollection implements + impl = impl.copy(); + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public Builder add(E element) { + requireNonNull(impl); // see the comment on the field + checkNotNull(element); +@@ -520,8 +520,8 @@ public abstract class ImmutableSet extends ImmutableCollection implements + return this; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public Builder add(E... elements) { + super.add(elements); + return this; +@@ -535,15 +535,15 @@ public abstract class ImmutableSet extends ImmutableCollection implements + * @return this {@code Builder} object + * @throws NullPointerException if {@code elements} is null or contains a null element + */ +- @Override + @CanIgnoreReturnValue ++ @Override + public Builder addAll(Iterable elements) { + super.addAll(elements); + return this; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public Builder addAll(Iterator elements) { + super.addAll(elements); + return this; +diff --git a/guava/src/com/google/common/collect/ImmutableSetMultimap.java b/guava/src/com/google/common/collect/ImmutableSetMultimap.java +index 52d6e55c34..f28c00ea62 100644 +--- a/guava/src/com/google/common/collect/ImmutableSetMultimap.java ++++ b/guava/src/com/google/common/collect/ImmutableSetMultimap.java +@@ -277,8 +277,8 @@ public class ImmutableSetMultimap extends ImmutableMultimap + * + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + @Override + public Builder putAll(Iterable> entries) { + super.putAll(entries); +@@ -492,8 +492,8 @@ public class ImmutableSetMultimap extends ImmutableMultimap + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final ImmutableSet removeAll(@CheckForNull Object key) { + throw new UnsupportedOperationException(); + } +@@ -506,8 +506,8 @@ public class ImmutableSetMultimap extends ImmutableMultimap + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final ImmutableSet replaceValues(K key, Iterable values) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableSortedMap.java b/guava/src/com/google/common/collect/ImmutableSortedMap.java +index ab971937d0..942803b421 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedMap.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedMap.java +@@ -678,8 +678,8 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + * @throws NullPointerException if any key, value, or entry is null + * @since 19.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + @Override + public Builder putAll(Iterable> entries) { + super.putAll(entries); +@@ -692,11 +692,11 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + * @since 19.0 + * @deprecated Unsupported by ImmutableSortedMap.Builder. + */ +- @CanIgnoreReturnValue + @Beta +- @Override ++ @CanIgnoreReturnValue + @Deprecated + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final Builder orderEntriesByValue(Comparator valueComparator) { + throw new UnsupportedOperationException("Not available on ImmutableSortedMap.Builder"); + } +@@ -753,8 +753,8 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + * @since 31.1 + * @deprecated This method is not currently implemented, and may never be. + */ +- @DoNotCall + @Deprecated ++ @DoNotCall + @Override + public final ImmutableSortedMap buildKeepingLast() { + // TODO(emcmanus): implement +@@ -794,8 +794,8 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + } + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + int index = keySet.indexOf(key); + return (index == -1) ? null : valueList.get(index); +@@ -1017,62 +1017,62 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + return getSubMap(keySet.tailIndex(checkNotNull(fromKey), inclusive), size()); + } + +- @Override + @CheckForNull ++ @Override + public Entry lowerEntry(K key) { + return headMap(key, false).lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(K key) { + return keyOrNull(lowerEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public Entry floorEntry(K key) { + return headMap(key, true).lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(K key) { + return keyOrNull(floorEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public Entry ceilingEntry(K key) { + return tailMap(key, true).firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(K key) { + return keyOrNull(ceilingEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public Entry higherEntry(K key) { + return tailMap(key, false).firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(K key) { + return keyOrNull(higherEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return isEmpty() ? null : entrySet().asList().get(0); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return isEmpty() ? null : entrySet().asList().get(size() - 1); + } +@@ -1084,10 +1084,10 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final Entry pollFirstEntry() { + throw new UnsupportedOperationException(); + } +@@ -1099,10 +1099,10 @@ public final class ImmutableSortedMap extends ImmutableSortedMapFauxveride + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final Entry pollLastEntry() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableSortedMapFauxverideShim.java b/guava/src/com/google/common/collect/ImmutableSortedMapFauxverideShim.java +index 7b2e4d7552..98b9f5d155 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedMapFauxverideShim.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedMapFauxverideShim.java +@@ -41,8 +41,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. + */ +- @DoNotCall("Use toImmutableSortedMap") + @Deprecated ++ @DoNotCall("Use toImmutableSortedMap") + public static + Collector> toImmutableMap( + Function keyFunction, +@@ -58,8 +58,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. + */ +- @DoNotCall("Use toImmutableSortedMap") + @Deprecated ++ @DoNotCall("Use toImmutableSortedMap") + public static + Collector> toImmutableMap( + Function keyFunction, +@@ -76,8 +76,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedMap#naturalOrder}, which offers better type-safety. + */ +- @DoNotCall("Use naturalOrder") + @Deprecated ++ @DoNotCall("Use naturalOrder") + public static ImmutableSortedMap.Builder builder() { + throw new UnsupportedOperationException(); + } +@@ -88,8 +88,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @throws UnsupportedOperationException always + * @deprecated Not supported for ImmutableSortedMap. + */ +- @DoNotCall("Use naturalOrder (which does not accept an expected size)") + @Deprecated ++ @DoNotCall("Use naturalOrder (which does not accept an expected size)") + public static ImmutableSortedMap.Builder builderWithExpectedSize(int expectedSize) { + throw new UnsupportedOperationException(); + } +@@ -103,8 +103,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @deprecated Pass a key of type {@code Comparable} to use {@link + * ImmutableSortedMap#of(Comparable, Object)}. + */ +- @DoNotCall("Pass a key of type Comparable") + @Deprecated ++ @DoNotCall("Pass a key of type Comparable") + public static ImmutableSortedMap of(K k1, V v1) { + throw new UnsupportedOperationException(); + } +@@ -118,8 +118,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @deprecated Pass keys of type {@code Comparable} to use {@link + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of(K k1, V v1, K k2, V v2) { + throw new UnsupportedOperationException(); + } +@@ -133,8 +133,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * @deprecated Pass keys of type {@code Comparable} to use {@link + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of(K k1, V v1, K k2, V v2, K k3, V v3) { + throw new UnsupportedOperationException(); + } +@@ -149,8 +149,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { + throw new UnsupportedOperationException(); + } +@@ -165,8 +165,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { + throw new UnsupportedOperationException(); +@@ -182,8 +182,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) { + throw new UnsupportedOperationException(); +@@ -199,8 +199,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) { + throw new UnsupportedOperationException(); +@@ -216,8 +216,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, + V v1, +@@ -248,8 +248,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, + V v1, +@@ -282,8 +282,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, + * Comparable, Object, Comparable, Object)}. + */ +- @DoNotCall("Pass keys of type Comparable") + @Deprecated ++ @DoNotCall("Pass keys of type Comparable") + public static ImmutableSortedMap of( + K k1, + V v1, +@@ -313,8 +313,8 @@ abstract class ImmutableSortedMapFauxverideShim extends ImmutableMap + * + * @deprecated Use {@code ImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...))}. + */ +- @DoNotCall("ImmutableSortedMap.ofEntries not currently available; use ImmutableSortedMap.copyOf") + @Deprecated ++ @DoNotCall("ImmutableSortedMap.ofEntries not currently available; use ImmutableSortedMap.copyOf") + public static ImmutableSortedMap ofEntries( + Entry... entries) { + throw new UnsupportedOperationException(); +diff --git a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java +index 0638df04e0..b3e2ce151e 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedMultiset.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedMultiset.java +@@ -16,6 +16,7 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.function.Function.identity; + + import com.google.common.annotations.GwtIncompatible; + import com.google.errorprone.annotations.CanIgnoreReturnValue; +@@ -67,7 +68,7 @@ public abstract class ImmutableSortedMultiset extends ImmutableSortedMultiset + */ + public static Collector> toImmutableSortedMultiset( + Comparator comparator) { +- return toImmutableSortedMultiset(comparator, Function.identity(), e -> 1); ++ return toImmutableSortedMultiset(comparator, identity(), e -> 1); + } + + /** +@@ -354,10 +355,10 @@ public abstract class ImmutableSortedMultiset extends ImmutableSortedMultiset + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final Entry pollFirstEntry() { + throw new UnsupportedOperationException(); + } +@@ -371,10 +372,10 @@ public abstract class ImmutableSortedMultiset extends ImmutableSortedMultiset + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final Entry pollLastEntry() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableSortedMultisetFauxverideShim.java b/guava/src/com/google/common/collect/ImmutableSortedMultisetFauxverideShim.java +index 94a2f560da..3ae13a3edf 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedMultisetFauxverideShim.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedMultisetFauxverideShim.java +@@ -50,8 +50,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Use {@link ImmutableSortedMultiset#toImmutableSortedMultiset}. + * @since 21.0 + */ +- @DoNotCall("Use toImmutableSortedMultiset.") + @Deprecated ++ @DoNotCall("Use toImmutableSortedMultiset.") + public static Collector> toImmutableMultiset() { + throw new UnsupportedOperationException(); + } +@@ -65,8 +65,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Use {@link ImmutableSortedMultiset#toImmutableSortedMultiset}. + * @since 22.0 + */ +- @DoNotCall("Use toImmutableSortedMultiset.") + @Deprecated ++ @DoNotCall("Use toImmutableSortedMultiset.") + public static + Collector> toImmutableMultiset( + Function elementFunction, +@@ -82,8 +82,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedMultiset#naturalOrder}, which offers better type-safety. + */ +- @DoNotCall("Use naturalOrder.") + @Deprecated ++ @DoNotCall("Use naturalOrder.") + public static ImmutableSortedMultiset.Builder builder() { + throw new UnsupportedOperationException(); + } +@@ -97,8 +97,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Pass a parameter of type {@code Comparable} to use {@link + * ImmutableSortedMultiset#of(Comparable)}. + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of(E element) { + throw new UnsupportedOperationException(); + } +@@ -112,8 +112,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedMultiset#of(Comparable, Comparable)}. + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of(E e1, E e2) { + throw new UnsupportedOperationException(); + } +@@ -127,8 +127,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable)}. + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of(E e1, E e2, E e3) { + throw new UnsupportedOperationException(); + } +@@ -142,8 +142,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable)}. + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of(E e1, E e2, E e3, E e4) { + throw new UnsupportedOperationException(); + } +@@ -158,8 +158,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable)} . + * + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of(E e1, E e2, E e3, E e4, E e5) { + throw new UnsupportedOperationException(); + } +@@ -174,8 +174,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * ImmutableSortedMultiset#of(Comparable, Comparable, Comparable, Comparable, Comparable, + * Comparable, Comparable...)} . + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset of( + E e1, E e2, E e3, E e4, E e5, E e6, E... remaining) { + throw new UnsupportedOperationException(); +@@ -190,8 +190,8 @@ abstract class ImmutableSortedMultisetFauxverideShim extends ImmutableMultise + * @deprecated Pass parameters of type {@code Comparable} to use {@link + * ImmutableSortedMultiset#copyOf(Comparable[])}. + */ +- @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + @Deprecated ++ @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)") + public static ImmutableSortedMultiset copyOf(E[] elements) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableSortedSet.java b/guava/src/com/google/common/collect/ImmutableSortedSet.java +index 695dadc67b..5b0a1e8cd2 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedSet.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedSet.java +@@ -585,7 +585,7 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + // Pretend the comparator can compare anything. If it turns out it can't + // compare a and b, we should get a CCE or NPE on the subsequent line. Only methods + // that are spec'd to throw CCE and NPE should call this. +- @SuppressWarnings({"unchecked", "nullness"}) ++ @SuppressWarnings({"nullness", "unchecked"}) + Comparator<@Nullable Object> unsafeComparator = (Comparator<@Nullable Object>) comparator; + return unsafeComparator.compare(a, b); + } +@@ -699,9 +699,9 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + /** + * @since 12.0 + */ +- @GwtIncompatible // NavigableSet ++ @CheckForNull // NavigableSet ++ @GwtIncompatible + @Override +- @CheckForNull + public E lower(E e) { + return Iterators.getNext(headSet(e, false).descendingIterator(), null); + } +@@ -709,8 +709,8 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + /** + * @since 12.0 + */ +- @Override + @CheckForNull ++ @Override + public E floor(E e) { + return Iterators.getNext(headSet(e, true).descendingIterator(), null); + } +@@ -718,8 +718,8 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + /** + * @since 12.0 + */ +- @Override + @CheckForNull ++ @Override + public E ceiling(E e) { + return Iterables.getFirst(tailSet(e, true), null); + } +@@ -727,9 +727,9 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + /** + * @since 12.0 + */ +- @GwtIncompatible // NavigableSet ++ @CheckForNull // NavigableSet ++ @GwtIncompatible + @Override +- @CheckForNull + public E higher(E e) { + return Iterables.getFirst(tailSet(e, false), null); + } +@@ -752,11 +752,11 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue +- @Deprecated +- @GwtIncompatible // NavigableSet +- @Override +- @DoNotCall("Always throws UnsupportedOperationException") + @CheckForNull ++ @Deprecated // NavigableSet ++ @DoNotCall("Always throws UnsupportedOperationException") ++ @GwtIncompatible ++ @Override + public final E pollFirst() { + throw new UnsupportedOperationException(); + } +@@ -769,11 +769,11 @@ public abstract class ImmutableSortedSet extends ImmutableSortedSetFauxveride + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue +- @Deprecated +- @GwtIncompatible // NavigableSet +- @Override +- @DoNotCall("Always throws UnsupportedOperationException") + @CheckForNull ++ @Deprecated // NavigableSet ++ @DoNotCall("Always throws UnsupportedOperationException") ++ @GwtIncompatible ++ @Override + public final E pollLast() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableSortedSetFauxverideShim.java b/guava/src/com/google/common/collect/ImmutableSortedSetFauxverideShim.java +index ff3ac12d5e..e73333271e 100644 +--- a/guava/src/com/google/common/collect/ImmutableSortedSetFauxverideShim.java ++++ b/guava/src/com/google/common/collect/ImmutableSortedSetFauxverideShim.java +@@ -48,8 +48,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Use {@link ImmutableSortedSet#toImmutableSortedSet}. + * @since 21.0 + */ +- @DoNotCall("Use toImmutableSortedSet") + @Deprecated ++ @DoNotCall("Use toImmutableSortedSet") + public static Collector> toImmutableSet() { + throw new UnsupportedOperationException(); + } +@@ -62,8 +62,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @throws UnsupportedOperationException always + * @deprecated Use {@link ImmutableSortedSet#naturalOrder}, which offers better type-safety. + */ +- @DoNotCall("Use naturalOrder") + @Deprecated ++ @DoNotCall("Use naturalOrder") + public static ImmutableSortedSet.Builder builder() { + throw new UnsupportedOperationException(); + } +@@ -75,8 +75,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @throws UnsupportedOperationException always + * @deprecated Not supported by ImmutableSortedSet. + */ +- @DoNotCall("Use naturalOrder (which does not accept an expected size)") + @Deprecated ++ @DoNotCall("Use naturalOrder (which does not accept an expected size)") + public static ImmutableSortedSet.Builder builderWithExpectedSize(int expectedSize) { + throw new UnsupportedOperationException(); + } +@@ -90,8 +90,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass a parameter of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable)}. + */ +- @DoNotCall("Pass a parameter of type Comparable") + @Deprecated ++ @DoNotCall("Pass a parameter of type Comparable") + public static ImmutableSortedSet of(E element) { + throw new UnsupportedOperationException(); + } +@@ -105,8 +105,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable)}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet of(E e1, E e2) { + throw new UnsupportedOperationException(); + } +@@ -120,8 +120,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable, Comparable)}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet of(E e1, E e2, E e3) { + throw new UnsupportedOperationException(); + } +@@ -135,8 +135,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable)}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet of(E e1, E e2, E e3, E e4) { + throw new UnsupportedOperationException(); + } +@@ -150,8 +150,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass the parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#of( Comparable, Comparable, Comparable, Comparable, Comparable)}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet of(E e1, E e2, E e3, E e4, E e5) { + throw new UnsupportedOperationException(); + } +@@ -166,8 +166,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * ImmutableSortedSet#of(Comparable, Comparable, Comparable, Comparable, Comparable, + * Comparable, Comparable...)}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet of(E e1, E e2, E e3, E e4, E e5, E e6, E... remaining) { + throw new UnsupportedOperationException(); + } +@@ -181,8 +181,8 @@ abstract class ImmutableSortedSetFauxverideShim extends ImmutableSet.CachingA + * @deprecated Pass parameters of type {@code Comparable} to use {@link + * ImmutableSortedSet#copyOf(Comparable[])}. + */ +- @DoNotCall("Pass parameters of type Comparable") + @Deprecated ++ @DoNotCall("Pass parameters of type Comparable") + public static ImmutableSortedSet copyOf(E[] elements) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/ImmutableTable.java b/guava/src/com/google/common/collect/ImmutableTable.java +index 033c271e6f..b49e440db3 100644 +--- a/guava/src/com/google/common/collect/ImmutableTable.java ++++ b/guava/src/com/google/common/collect/ImmutableTable.java +@@ -392,8 +392,8 @@ public abstract class ImmutableTable extends AbstractTable + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void clear() { + throw new UnsupportedOperationException(); + } +@@ -405,10 +405,10 @@ public abstract class ImmutableTable extends AbstractTable + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V put(R rowKey, C columnKey, V value) { + throw new UnsupportedOperationException(); + } +@@ -420,8 +420,8 @@ public abstract class ImmutableTable extends AbstractTable + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void putAll(Table table) { + throw new UnsupportedOperationException(); + } +@@ -433,10 +433,10 @@ public abstract class ImmutableTable extends AbstractTable + * @deprecated Unsupported operation. + */ + @CanIgnoreReturnValue ++ @CheckForNull + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") +- @CheckForNull ++ @Override + public final V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/IndexedImmutableSet.java b/guava/src/com/google/common/collect/IndexedImmutableSet.java +index 20dfacbab8..eb8fed17ba 100644 +--- a/guava/src/com/google/common/collect/IndexedImmutableSet.java ++++ b/guava/src/com/google/common/collect/IndexedImmutableSet.java +@@ -48,8 +48,8 @@ abstract class IndexedImmutableSet extends ImmutableSet.CachingAsList { + } + } + +- @Override + @GwtIncompatible ++ @Override + int copyIntoArray(@Nullable Object[] dst, int offset) { + return asList().copyIntoArray(dst, offset); + } +diff --git a/guava/src/com/google/common/collect/Iterables.java b/guava/src/com/google/common/collect/Iterables.java +index 7928b15d67..8fd6aad01e 100644 +--- a/guava/src/com/google/common/collect/Iterables.java ++++ b/guava/src/com/google/common/collect/Iterables.java +@@ -18,6 +18,7 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Predicates.instanceOf; + import static com.google.common.collect.CollectPreconditions.checkRemove; + + import com.google.common.annotations.Beta; +@@ -26,7 +27,6 @@ import com.google.common.annotations.GwtIncompatible; + import com.google.common.base.Function; + import com.google.common.base.Optional; + import com.google.common.base.Predicate; +-import com.google.common.base.Predicates; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.Collection; + import java.util.Comparator; +@@ -110,8 +110,8 @@ public final class Iterables { + iterable.forEach(action); + } + +- @SuppressWarnings("unchecked") // safe upcast, assuming no one has a crazy Spliterator subclass +- @Override ++ @Override // safe upcast, assuming no one has a crazy Spliterator subclass ++ @SuppressWarnings("unchecked") + public Spliterator spliterator() { + return (Spliterator) iterable.spliterator(); + } +@@ -390,7 +390,7 @@ public final class Iterables { + + @Override + public String toString() { +- return iterable.toString() + " (cycled)"; ++ return iterable + " (cycled)"; + } + }; + } +@@ -616,12 +616,12 @@ public final class Iterables { + * (ImmutableList) stream.filter(NewType.class::isInstance).collect(toImmutableList());} + * + */ +- @SuppressWarnings("unchecked") +- @GwtIncompatible // Class.isInstance ++ @GwtIncompatible ++ @SuppressWarnings("unchecked") // Class.isInstance + public static Iterable filter(final Iterable unfiltered, final Class desiredType) { + checkNotNull(unfiltered); + checkNotNull(desiredType); +- return (Iterable) filter(unfiltered, Predicates.instanceOf(desiredType)); ++ return (Iterable) filter(unfiltered, instanceOf(desiredType)); + } + + /** +diff --git a/guava/src/com/google/common/collect/Iterators.java b/guava/src/com/google/common/collect/Iterators.java +index 916e513349..3dbfdc791a 100644 +--- a/guava/src/com/google/common/collect/Iterators.java ++++ b/guava/src/com/google/common/collect/Iterators.java +@@ -18,10 +18,13 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndex; ++import static com.google.common.base.Preconditions.checkPositionIndexes; + import static com.google.common.base.Preconditions.checkState; + import static com.google.common.base.Predicates.instanceOf; + import static com.google.common.collect.CollectPreconditions.checkRemove; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableList; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -30,7 +33,6 @@ import com.google.common.annotations.GwtIncompatible; + import com.google.common.base.Function; + import com.google.common.base.Objects; + import com.google.common.base.Optional; +-import com.google.common.base.Preconditions; + import com.google.common.base.Predicate; + import com.google.common.primitives.Ints; + import com.google.errorprone.annotations.CanIgnoreReturnValue; +@@ -644,7 +646,7 @@ public final class Iterators { + array[i] = null; // for GWT + } + +- List<@Nullable T> list = Collections.unmodifiableList(Arrays.asList(array)); ++ List<@Nullable T> list = unmodifiableList(Arrays.asList(array)); + // TODO(b/192579700): Use a ternary once it no longer confuses our nullness checker. + if (pad || count == size) { + return list; +@@ -664,8 +666,8 @@ public final class Iterators { + checkNotNull(unfiltered); + checkNotNull(retainIfTrue); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected T computeNext() { + while (unfiltered.hasNext()) { + T element = unfiltered.next(); +@@ -682,8 +684,8 @@ public final class Iterators { + * Returns a view of {@code unfiltered} containing all elements that are of the type {@code + * desiredType}. + */ +- @SuppressWarnings("unchecked") // can cast to because non-Ts are removed +- @GwtIncompatible // Class.isInstance ++ @GwtIncompatible // can cast to because non-Ts are removed ++ @SuppressWarnings("unchecked") // Class.isInstance + public static UnmodifiableIterator filter(Iterator unfiltered, Class desiredType) { + return (UnmodifiableIterator) filter(unfiltered, instanceOf(desiredType)); + } +@@ -822,8 +824,8 @@ public final class Iterators { + Iterator fromIterator, Function function) { + checkNotNull(function); + return new TransformedIterator(fromIterator) { +- @ParametricNullness + @Override ++ @ParametricNullness + T transform(@ParametricNullness F from) { + return function.apply(from); + } +@@ -1070,8 +1072,8 @@ public final class Iterators { + int end = offset + length; + + // Technically we should give a slightly more descriptive error on overflow +- Preconditions.checkPositionIndexes(offset, end, array.length); +- Preconditions.checkPositionIndex(index, length); ++ checkPositionIndexes(offset, end, array.length); ++ checkPositionIndex(index, length); + if (length == 0) { + return emptyListIterator(); + } +diff --git a/guava/src/com/google/common/collect/JdkBackedImmutableBiMap.java b/guava/src/com/google/common/collect/JdkBackedImmutableBiMap.java +index f126fdea3b..e97a6f428d 100644 +--- a/guava/src/com/google/common/collect/JdkBackedImmutableBiMap.java ++++ b/guava/src/com/google/common/collect/JdkBackedImmutableBiMap.java +@@ -104,8 +104,8 @@ final class JdkBackedImmutableBiMap extends ImmutableBiMap { + } + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return forwardDelegate.get(key); + } +diff --git a/guava/src/com/google/common/collect/JdkBackedImmutableMap.java b/guava/src/com/google/common/collect/JdkBackedImmutableMap.java +index 222c4deb8a..d7abde3a3d 100644 +--- a/guava/src/com/google/common/collect/JdkBackedImmutableMap.java ++++ b/guava/src/com/google/common/collect/JdkBackedImmutableMap.java +@@ -99,8 +99,8 @@ final class JdkBackedImmutableMap extends ImmutableMap { + return entries.size(); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return delegateMap.get(key); + } +diff --git a/guava/src/com/google/common/collect/LinkedListMultimap.java b/guava/src/com/google/common/collect/LinkedListMultimap.java +index a69243469c..f6cbca6142 100644 +--- a/guava/src/com/google/common/collect/LinkedListMultimap.java ++++ b/guava/src/com/google/common/collect/LinkedListMultimap.java +@@ -684,7 +684,7 @@ public class LinkedListMultimap oldValues = getCopy(castKey); + removeAllNodes(castKey); +diff --git a/guava/src/com/google/common/collect/Lists.java b/guava/src/com/google/common/collect/Lists.java +index e7f3817fd0..57b5c2dd80 100644 +--- a/guava/src/com/google/common/collect/Lists.java ++++ b/guava/src/com/google/common/collect/Lists.java +@@ -99,8 +99,8 @@ public final class Lists { + * (...))}, or for creating an empty list then calling {@link Collections#addAll}. This method is + * not actually very useful and will likely be deprecated in the future. + */ +- @SafeVarargs + @GwtCompatible(serializable = true) ++ @SafeVarargs + public static ArrayList newArrayList(E... elements) { + checkNotNull(elements); // for GWT + // Avoid integer overflow when a large array is passed in +diff --git a/guava/src/com/google/common/collect/MapMakerInternalMap.java b/guava/src/com/google/common/collect/MapMakerInternalMap.java +index 5e7daa50da..cc1f4534ae 100644 +--- a/guava/src/com/google/common/collect/MapMakerInternalMap.java ++++ b/guava/src/com/google/common/collect/MapMakerInternalMap.java +@@ -583,8 +583,6 @@ class MapMakerInternalMap< + return Dummy.VALUE; + } + +- void setValue(Dummy value) {} +- + StrongKeyDummyValueEntry copy(StrongKeyDummyValueEntry newNext) { + return new StrongKeyDummyValueEntry(this.key, this.hash, newNext); + } +@@ -687,8 +685,6 @@ class MapMakerInternalMap< + return Dummy.VALUE; + } + +- void setValue(Dummy value) {} +- + WeakKeyDummyValueEntry copy( + ReferenceQueue queueForKeys, WeakKeyDummyValueEntry newNext) { + return new WeakKeyDummyValueEntry(queueForKeys, getKey(), this.hash, newNext); +@@ -2008,8 +2004,8 @@ class MapMakerInternalMap< + return this; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public StrongKeyStrongValueEntry castForTesting(InternalEntry entry) { + return (StrongKeyStrongValueEntry) entry; + } +@@ -2038,8 +2034,8 @@ class MapMakerInternalMap< + return queueForValues; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public StrongKeyWeakValueEntry castForTesting(InternalEntry entry) { + return (StrongKeyWeakValueEntry) entry; + } +@@ -2096,8 +2092,8 @@ class MapMakerInternalMap< + return this; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public StrongKeyDummyValueEntry castForTesting(InternalEntry entry) { + return (StrongKeyDummyValueEntry) entry; + } +@@ -2126,8 +2122,8 @@ class MapMakerInternalMap< + return queueForKeys; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public WeakKeyStrongValueEntry castForTesting(InternalEntry entry) { + return (WeakKeyStrongValueEntry) entry; + } +@@ -2171,8 +2167,8 @@ class MapMakerInternalMap< + return queueForValues; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public WeakKeyWeakValueEntry castForTesting(InternalEntry entry) { + return (WeakKeyWeakValueEntry) entry; + } +@@ -2236,8 +2232,8 @@ class MapMakerInternalMap< + return queueForKeys; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public WeakKeyDummyValueEntry castForTesting(InternalEntry entry) { + return (WeakKeyDummyValueEntry) entry; + } +diff --git a/guava/src/com/google/common/collect/Maps.java b/guava/src/com/google/common/collect/Maps.java +index 64ea2892df..819fa6d216 100644 +--- a/guava/src/com/google/common/collect/Maps.java ++++ b/guava/src/com/google/common/collect/Maps.java +@@ -22,6 +22,8 @@ import static com.google.common.base.Predicates.compose; + import static com.google.common.collect.CollectPreconditions.checkEntryNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableSet; ++import static java.util.Collections.unmodifiableSortedMap; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -31,7 +33,6 @@ import com.google.common.base.Converter; + import com.google.common.base.Equivalence; + import com.google.common.base.Function; + import com.google.common.base.Objects; +-import com.google.common.base.Preconditions; + import com.google.common.base.Predicate; + import com.google.common.base.Predicates; + import com.google.common.collect.MapDifference.ValueDifference; +@@ -94,15 +95,15 @@ public final class Maps { + + private enum EntryFunction implements Function, @Nullable Object> { + KEY { +- @Override + @CheckForNull ++ @Override + public Object apply(Entry entry) { + return entry.getKey(); + } + }, + VALUE { +- @Override + @CheckForNull ++ @Override + public Object apply(Entry entry) { + return entry.getValue(); + } +@@ -537,7 +538,7 @@ public final class Maps { + Map left, + Map right, + Equivalence valueEquivalence) { +- Preconditions.checkNotNull(valueEquivalence); ++ checkNotNull(valueEquivalence); + + Map onlyOnLeft = newLinkedHashMap(); + Map onlyOnRight = new LinkedHashMap<>(right); // will whittle it down +@@ -629,7 +630,7 @@ public final class Maps { + private static Map unmodifiableMap( + Map map) { + if (map instanceof SortedMap) { +- return Collections.unmodifiableSortedMap((SortedMap) map); ++ return unmodifiableSortedMap((SortedMap) map); + } else { + return Collections.unmodifiableMap(map); + } +@@ -933,14 +934,14 @@ public final class Maps { + return backingSet().contains(key); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return getOrDefault(key, null); + } + +- @Override + @CheckForNull ++ @Override + public V getOrDefault(@CheckForNull Object key, @CheckForNull V defaultValue) { + if (Collections2.safeContains(backingSet(), key)) { + @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it +@@ -951,8 +952,8 @@ public final class Maps { + } + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + if (backingSet().remove(key)) { + @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it +@@ -1015,8 +1016,8 @@ public final class Maps { + return (SortedSet) super.backingSet(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return backingSet().comparator(); + } +@@ -1090,20 +1091,20 @@ public final class Maps { + return asMap(set.tailSet(fromKey, inclusive), function); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return set.comparator(); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return getOrDefault(key, null); + } + +- @Override + @CheckForNull ++ @Override + public V getOrDefault(@CheckForNull Object key, @CheckForNull V defaultValue) { + if (Collections2.safeContains(set, key)) { + @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it +@@ -1476,7 +1477,7 @@ public final class Maps { + */ + static + Set> unmodifiableEntrySet(Set> entrySet) { +- return new UnmodifiableEntrySet<>(Collections.unmodifiableSet(entrySet)); ++ return new UnmodifiableEntrySet<>(unmodifiableSet(entrySet)); + } + + /** +@@ -1717,8 +1718,8 @@ public final class Maps { + return unmodifiableMap; + } + +- @Override + @CheckForNull ++ @Override + public V forcePut(@ParametricNullness K key, @ParametricNullness V value) { + throw new UnsupportedOperationException(); + } +@@ -1728,8 +1729,8 @@ public final class Maps { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V putIfAbsent(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -1744,8 +1745,8 @@ public final class Maps { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V replace(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -1785,7 +1786,7 @@ public final class Maps { + @Override + public Set values() { + Set result = values; +- return (result == null) ? values = Collections.unmodifiableSet(delegate.values()) : result; ++ return (result == null) ? values = unmodifiableSet(delegate.values()) : result; + } + + private static final long serialVersionUID = 0; +@@ -2208,16 +2209,16 @@ public final class Maps { + return fromMap.containsKey(key); + } + +- @Override + @CheckForNull ++ @Override + public V2 get(@CheckForNull Object key) { + return getOrDefault(key, null); + } + + // safe as long as the user followed the Warning in the javadoc +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public V2 getOrDefault(@CheckForNull Object key, @CheckForNull V2 defaultValue) { + V1 value = fromMap.get(key); + if (value != null || fromMap.containsKey(key)) { +@@ -2228,9 +2229,9 @@ public final class Maps { + } + + // safe as long as the user followed the Warning in the javadoc +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public V2 remove(@CheckForNull Object key) { + return fromMap.containsKey(key) + // The cast is safe because of the containsKey check. +@@ -2286,8 +2287,8 @@ public final class Maps { + super(fromMap, transformer); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return fromMap().comparator(); + } +@@ -2330,14 +2331,14 @@ public final class Maps { + super(fromMap, transformer); + } + +- @Override + @CheckForNull ++ @Override + public Entry ceilingEntry(@ParametricNullness K key) { + return transformEntry(fromMap().ceilingEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(@ParametricNullness K key) { + return fromMap().ceilingKey(key); + } +@@ -2352,20 +2353,20 @@ public final class Maps { + return transformEntries(fromMap().descendingMap(), transformer); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return transformEntry(fromMap().firstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public Entry floorEntry(@ParametricNullness K key) { + return transformEntry(fromMap().floorEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(@ParametricNullness K key) { + return fromMap().floorKey(key); + } +@@ -2380,32 +2381,32 @@ public final class Maps { + return transformEntries(fromMap().headMap(toKey, inclusive), transformer); + } + +- @Override + @CheckForNull ++ @Override + public Entry higherEntry(@ParametricNullness K key) { + return transformEntry(fromMap().higherEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(@ParametricNullness K key) { + return fromMap().higherKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return transformEntry(fromMap().lastEntry()); + } + +- @Override + @CheckForNull ++ @Override + public Entry lowerEntry(@ParametricNullness K key) { + return transformEntry(fromMap().lowerEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(@ParametricNullness K key) { + return fromMap().lowerKey(key); + } +@@ -2415,14 +2416,14 @@ public final class Maps { + return fromMap().navigableKeySet(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return transformEntry(fromMap().pollFirstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return transformEntry(fromMap().pollLastEntry()); + } +@@ -2926,13 +2927,13 @@ public final class Maps { + boolean apply(@CheckForNull Object key, @ParametricNullness V value) { + // This method is called only when the key is in the map (or about to be added to the map), + // implying that key is a K. +- @SuppressWarnings({"unchecked", "nullness"}) ++ @SuppressWarnings({"nullness", "unchecked"}) + K k = (K) key; + return predicate.apply(Maps.immutableEntry(k, value)); + } + +- @Override + @CheckForNull ++ @Override + public V put(@ParametricNullness K key, @ParametricNullness V value) { + checkArgument(apply(key, value)); + return unfiltered.put(key, value); +@@ -2951,8 +2952,8 @@ public final class Maps { + return unfiltered.containsKey(key) && apply(key, unfiltered.get(key)); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + V value = unfiltered.get(key); + return ((value != null) && apply(key, value)) ? value : null; +@@ -2963,8 +2964,8 @@ public final class Maps { + return entrySet().isEmpty(); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + return containsKey(key) ? unfiltered.remove(key) : null; + } +@@ -3218,8 +3219,8 @@ public final class Maps { + + @WeakOuter + class SortedKeySet extends KeySet implements SortedSet { +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return sortedMap().comparator(); + } +@@ -3253,8 +3254,8 @@ public final class Maps { + } + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return sortedMap().comparator(); + } +@@ -3318,8 +3319,8 @@ public final class Maps { + this.filteredDelegate = new FilteredEntryMap<>(unfiltered, entryPredicate); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return unfiltered.comparator(); + } +@@ -3364,8 +3365,8 @@ public final class Maps { + return !Iterables.any(unfiltered.entrySet(), entryPredicate); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return filteredDelegate.get(key); + } +@@ -3375,14 +3376,14 @@ public final class Maps { + return filteredDelegate.containsKey(key); + } + +- @Override + @CheckForNull ++ @Override + public V put(@ParametricNullness K key, @ParametricNullness V value) { + return filteredDelegate.put(key, value); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + return filteredDelegate.remove(key); + } +@@ -3402,14 +3403,14 @@ public final class Maps { + return filteredDelegate.entrySet(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return Iterables.removeFirstMatching(unfiltered.entrySet(), entryPredicate); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return Iterables.removeFirstMatching(unfiltered.descendingMap().entrySet(), entryPredicate); + } +@@ -3471,8 +3472,8 @@ public final class Maps { + return (BiMap) unfiltered; + } + +- @Override + @CheckForNull ++ @Override + public V forcePut(@ParametricNullness K key, @ParametricNullness V value) { + checkArgument(apply(key, value)); + return unfiltered().forcePut(key, value); +@@ -3553,77 +3554,77 @@ public final class Maps { + + @Override + protected SortedMap delegate() { +- return Collections.unmodifiableSortedMap(delegate); ++ return unmodifiableSortedMap(delegate); + } + +- @Override + @CheckForNull ++ @Override + public Entry lowerEntry(@ParametricNullness K key) { + return unmodifiableOrNull(delegate.lowerEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(@ParametricNullness K key) { + return delegate.lowerKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry floorEntry(@ParametricNullness K key) { + return unmodifiableOrNull(delegate.floorEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(@ParametricNullness K key) { + return delegate.floorKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry ceilingEntry(@ParametricNullness K key) { + return unmodifiableOrNull(delegate.ceilingEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(@ParametricNullness K key) { + return delegate.ceilingKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry higherEntry(@ParametricNullness K key) { + return unmodifiableOrNull(delegate.higherEntry(key)); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(@ParametricNullness K key) { + return delegate.higherKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return unmodifiableOrNull(delegate.firstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return unmodifiableOrNull(delegate.lastEntry()); + } + +- @Override + @CheckForNull ++ @Override + public final Entry pollFirstEntry() { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public final Entry pollLastEntry() { + throw new UnsupportedOperationException(); + } +@@ -3633,8 +3634,8 @@ public final class Maps { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V putIfAbsent(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -3649,8 +3650,8 @@ public final class Maps { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V replace(K key, V value) { + throw new UnsupportedOperationException(); + } +@@ -4088,8 +4089,8 @@ public final class Maps { + return (SortedMap) super.map(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return map().comparator(); + } +@@ -4134,38 +4135,38 @@ public final class Maps { + return (NavigableMap) map; + } + +- @Override + @CheckForNull ++ @Override + public K lower(@ParametricNullness K e) { + return map().lowerKey(e); + } + +- @Override + @CheckForNull ++ @Override + public K floor(@ParametricNullness K e) { + return map().floorKey(e); + } + +- @Override + @CheckForNull ++ @Override + public K ceiling(@ParametricNullness K e) { + return map().ceilingKey(e); + } + +- @Override + @CheckForNull ++ @Override + public K higher(@ParametricNullness K e) { + return map().higherKey(e); + } + +- @Override + @CheckForNull ++ @Override + public K pollFirst() { + return keyOrNull(map().pollFirstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public K pollLast() { + return keyOrNull(map().pollLastEntry()); + } +@@ -4393,8 +4394,8 @@ public final class Maps { + + @CheckForNull private transient Comparator comparator; + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Comparator comparator() { + Comparator result = comparator; + if (result == null) { +@@ -4424,74 +4425,74 @@ public final class Maps { + return forward().firstKey(); + } + +- @Override + @CheckForNull ++ @Override + public Entry lowerEntry(@ParametricNullness K key) { + return forward().higherEntry(key); + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(@ParametricNullness K key) { + return forward().higherKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry floorEntry(@ParametricNullness K key) { + return forward().ceilingEntry(key); + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(@ParametricNullness K key) { + return forward().ceilingKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry ceilingEntry(@ParametricNullness K key) { + return forward().floorEntry(key); + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(@ParametricNullness K key) { + return forward().floorKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry higherEntry(@ParametricNullness K key) { + return forward().lowerEntry(key); + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(@ParametricNullness K key) { + return forward().lowerKey(key); + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return forward().lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return forward().firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + return forward().pollLastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + return forward().pollFirstEntry(); + } +diff --git a/guava/src/com/google/common/collect/MinMaxPriorityQueue.java b/guava/src/com/google/common/collect/MinMaxPriorityQueue.java +index 181b3fbb50..4258f7d8d6 100644 +--- a/guava/src/com/google/common/collect/MinMaxPriorityQueue.java ++++ b/guava/src/com/google/common/collect/MinMaxPriorityQueue.java +@@ -300,8 +300,8 @@ public final class MinMaxPriorityQueue extends AbstractQueue { + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public E poll() { + return isEmpty() ? null : removeAndGet(0); + } +@@ -315,8 +315,8 @@ public final class MinMaxPriorityQueue extends AbstractQueue { + return (E) requireNonNull(queue[index]); + } + +- @Override + @CheckForNull ++ @Override + public E peek() { + return isEmpty() ? null : elementData(0); + } +@@ -409,9 +409,9 @@ public final class MinMaxPriorityQueue extends AbstractQueue { + * down to replace the element at {@code index}. This fact is used by iterator.remove so as to + * visit elements during a traversal once and only once. + */ +- @VisibleForTesting + @CanIgnoreReturnValue + @CheckForNull ++ @VisibleForTesting + MoveDesc removeAt(int index) { + checkPositionIndex(index, size); + modCount++; +diff --git a/guava/src/com/google/common/collect/MultimapBuilder.java b/guava/src/com/google/common/collect/MultimapBuilder.java +index 3d6278aaec..6a6da896e4 100644 +--- a/guava/src/com/google/common/collect/MultimapBuilder.java ++++ b/guava/src/com/google/common/collect/MultimapBuilder.java +@@ -172,8 +172,8 @@ public abstract class MultimapBuilder> MultimapBuilderWithKeys enumKeys(Class keyClass) { + checkNotNull(keyClass); + return new MultimapBuilderWithKeys() { +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Map> createMap() { + // K must actually be K0, since enums are effectively final + // (their subclasses are inaccessible) +@@ -395,7 +395,7 @@ public abstract class MultimapBuilder SetMultimap build() { + // V must actually be V0, since enums are effectively final + // (their subclasses are inaccessible) +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + Supplier> factory = (Supplier) new EnumSetSupplier(valueClass); + return Multimaps.newSetMultimap(MultimapBuilderWithKeys.this.createMap(), factory); + } +diff --git a/guava/src/com/google/common/collect/Multimaps.java b/guava/src/com/google/common/collect/Multimaps.java +index 1c3f8cc4a6..18f2a65033 100644 +--- a/guava/src/com/google/common/collect/Multimaps.java ++++ b/guava/src/com/google/common/collect/Multimaps.java +@@ -20,6 +20,11 @@ import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; + import static com.google.common.collect.CollectPreconditions.checkRemove; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableCollection; ++import static java.util.Collections.unmodifiableList; ++import static java.util.Collections.unmodifiableMap; ++import static java.util.Collections.unmodifiableSet; ++import static java.util.Collections.unmodifiableSortedSet; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -40,7 +45,6 @@ import java.io.ObjectOutputStream; + import java.io.Serializable; + import java.util.AbstractCollection; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.HashSet; + import java.util.Iterator; +@@ -242,13 +246,13 @@ public final class Multimaps { + if (collection instanceof NavigableSet) { + return Sets.unmodifiableNavigableSet((NavigableSet) collection); + } else if (collection instanceof SortedSet) { +- return Collections.unmodifiableSortedSet((SortedSet) collection); ++ return unmodifiableSortedSet((SortedSet) collection); + } else if (collection instanceof Set) { +- return Collections.unmodifiableSet((Set) collection); ++ return unmodifiableSet((Set) collection); + } else if (collection instanceof List) { +- return Collections.unmodifiableList((List) collection); ++ return unmodifiableList((List) collection); + } else { +- return Collections.unmodifiableCollection(collection); ++ return unmodifiableCollection(collection); + } + } + +@@ -441,9 +445,9 @@ public final class Multimaps { + if (collection instanceof NavigableSet) { + return Sets.unmodifiableNavigableSet((NavigableSet) collection); + } else if (collection instanceof SortedSet) { +- return Collections.unmodifiableSortedSet((SortedSet) collection); ++ return unmodifiableSortedSet((SortedSet) collection); + } else { +- return Collections.unmodifiableSet((Set) collection); ++ return unmodifiableSet((Set) collection); + } + } + +@@ -543,8 +547,8 @@ public final class Multimaps { + return factory.get(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator valueComparator() { + return valueComparator; + } +@@ -690,7 +694,7 @@ public final class Multimaps { + if (result == null) { + result = + map = +- Collections.unmodifiableMap( ++ unmodifiableMap( + Maps.transformValues( + delegate.asMap(), + new Function, Collection>() { +@@ -735,7 +739,7 @@ public final class Multimaps { + public Set keySet() { + Set result = keySet; + if (result == null) { +- keySet = result = Collections.unmodifiableSet(delegate.keySet()); ++ keySet = result = unmodifiableSet(delegate.keySet()); + } + return result; + } +@@ -774,7 +778,7 @@ public final class Multimaps { + public Collection values() { + Collection result = values; + if (result == null) { +- values = result = Collections.unmodifiableCollection(delegate.values()); ++ values = result = unmodifiableCollection(delegate.values()); + } + return result; + } +@@ -796,7 +800,7 @@ public final class Multimaps { + + @Override + public List get(@ParametricNullness K key) { +- return Collections.unmodifiableList(delegate().get(key)); ++ return unmodifiableList(delegate().get(key)); + } + + @Override +@@ -830,7 +834,7 @@ public final class Multimaps { + * Note that this doesn't return a SortedSet when delegate is a + * SortedSetMultiset, unlike (SortedSet) super.get(). + */ +- return Collections.unmodifiableSet(delegate().get(key)); ++ return unmodifiableSet(delegate().get(key)); + } + + @Override +@@ -865,7 +869,7 @@ public final class Multimaps { + + @Override + public SortedSet get(@ParametricNullness K key) { +- return Collections.unmodifiableSortedSet(delegate().get(key)); ++ return unmodifiableSortedSet(delegate().get(key)); + } + + @Override +@@ -878,8 +882,8 @@ public final class Multimaps { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator valueComparator() { + return delegate().valueComparator(); + } +@@ -1023,13 +1027,13 @@ public final class Multimaps { + private static Collection unmodifiableValueCollection( + Collection collection) { + if (collection instanceof SortedSet) { +- return Collections.unmodifiableSortedSet((SortedSet) collection); ++ return unmodifiableSortedSet((SortedSet) collection); + } else if (collection instanceof Set) { +- return Collections.unmodifiableSet((Set) collection); ++ return unmodifiableSet((Set) collection); + } else if (collection instanceof List) { +- return Collections.unmodifiableList((List) collection); ++ return unmodifiableList((List) collection); + } +- return Collections.unmodifiableCollection(collection); ++ return unmodifiableCollection(collection); + } + + /** +@@ -1045,7 +1049,7 @@ public final class Multimaps { + if (entries instanceof Set) { + return Maps.unmodifiableEntrySet((Set>) entries); + } +- return new Maps.UnmodifiableEntries<>(Collections.unmodifiableCollection(entries)); ++ return new Maps.UnmodifiableEntries<>(unmodifiableCollection(entries)); + } + + /** +@@ -1581,14 +1585,14 @@ public final class Multimaps { + throw new UnsupportedOperationException(); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public boolean remove(@CheckForNull Object key, @CheckForNull Object value) { + return get((K) key).remove(value); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Collection removeAll(@CheckForNull Object key) { + return transform((K) key, fromMultimap.removeAll(key)); + } +@@ -1629,8 +1633,8 @@ public final class Multimaps { + return transform(key, fromMultimap.get(key)); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public List removeAll(@CheckForNull Object key) { + return transform((K) key, fromMultimap.removeAll(key)); + } +@@ -1926,15 +1930,15 @@ public final class Multimaps { + } + } + +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public Collection get(@CheckForNull Object key) { + return containsKey(key) ? multimap.get((K) key) : null; + } + +- @Override + @CheckForNull ++ @Override + public Collection remove(@CheckForNull Object key) { + return containsKey(key) ? multimap.removeAll(key) : null; + } +diff --git a/guava/src/com/google/common/collect/Multisets.java b/guava/src/com/google/common/collect/Multisets.java +index 71fe614347..6582569694 100644 +--- a/guava/src/com/google/common/collect/Multisets.java ++++ b/guava/src/com/google/common/collect/Multisets.java +@@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; + import static com.google.common.collect.CollectPreconditions.checkRemove; ++import static java.util.Collections.unmodifiableSet; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -128,8 +129,8 @@ public final class Multisets { + this.delegate = delegate; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + protected Multiset delegate() { + // This is safe because all non-covariant methods are overridden + return (Multiset) delegate; +@@ -149,14 +150,14 @@ public final class Multisets { + + @CheckForNull transient Set> entrySet; + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Set> entrySet() { + Set> es = entrySet; + return (es == null) + // Safe because the returned set is made unmodifiable and Entry + // itself is readonly +- ? entrySet = (Set) Collections.unmodifiableSet(delegate.entrySet()) ++ ? entrySet = (Set) unmodifiableSet(delegate.entrySet()) + : es; + } + +@@ -449,8 +450,8 @@ public final class Multisets { + final Iterator> iterator2 = multiset2.entrySet().iterator(); + // TODO(lowasser): consider making the entries live views + return new AbstractIterator>() { +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + if (iterator1.hasNext()) { + Entry entry1 = iterator1.next(); +@@ -511,8 +512,8 @@ public final class Multisets { + final Iterator> iterator1 = multiset1.entrySet().iterator(); + // TODO(lowasser): consider making the entries live views + return new AbstractIterator>() { +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + while (iterator1.hasNext()) { + Entry entry1 = iterator1.next(); +@@ -584,8 +585,8 @@ public final class Multisets { + final Iterator> iterator1 = multiset1.entrySet().iterator(); + final Iterator> iterator2 = multiset2.entrySet().iterator(); + return new AbstractIterator>() { +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + if (iterator1.hasNext()) { + Entry entry1 = iterator1.next(); +@@ -642,8 +643,8 @@ public final class Multisets { + Iterator elementIterator() { + final Iterator> iterator1 = multiset1.entrySet().iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + while (iterator1.hasNext()) { + Entry entry1 = iterator1.next(); +@@ -661,8 +662,8 @@ public final class Multisets { + Iterator> entryIterator() { + final Iterator> iterator1 = multiset1.entrySet().iterator(); + return new AbstractIterator>() { +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + while (iterator1.hasNext()) { + Entry entry1 = iterator1.next(); +@@ -1045,8 +1046,8 @@ public final class Multisets { + } + + // GWT compiler warning; see contains(). +- @SuppressWarnings("cast") + @Override ++ @SuppressWarnings("cast") + public boolean remove(@CheckForNull Object object) { + if (object instanceof Multiset.Entry) { + Entry entry = (Entry) object; +@@ -1055,7 +1056,7 @@ public final class Multisets { + if (entryCount != 0) { + // Safe as long as we never add a new entry, which we won't. + // (Presumably it can still throw CCE/NPE but only if the underlying Multiset does.) +- @SuppressWarnings({"unchecked", "nullness"}) ++ @SuppressWarnings({"nullness", "unchecked"}) + Multiset<@Nullable Object> multiset = (Multiset<@Nullable Object>) multiset(); + return multiset.setCount(element, entryCount, 0); + } +diff --git a/guava/src/com/google/common/collect/MutableClassToInstanceMap.java b/guava/src/com/google/common/collect/MutableClassToInstanceMap.java +index 83fbe94472..738e167551 100644 +--- a/guava/src/com/google/common/collect/MutableClassToInstanceMap.java ++++ b/guava/src/com/google/common/collect/MutableClassToInstanceMap.java +@@ -144,9 +144,9 @@ public final class MutableClassToInstanceMap extends ForwardingMap key, B value) { + return super.put(key, cast(key, value)); + } +@@ -161,14 +161,14 @@ public final class MutableClassToInstanceMap extends ForwardingMap T putInstance(Class type, T value) { + return cast(type, put(type, value)); + } + +- @Override + @CheckForNull ++ @Override + public T getInstance(Class type) { + return cast(type, get(type)); + } +diff --git a/guava/src/com/google/common/collect/NaturalOrdering.java b/guava/src/com/google/common/collect/NaturalOrdering.java +index 8cb8aef9a0..2789ab4567 100644 +--- a/guava/src/com/google/common/collect/NaturalOrdering.java ++++ b/guava/src/com/google/common/collect/NaturalOrdering.java +@@ -25,7 +25,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; + + /** An ordering that uses the natural order of the values. */ + @GwtCompatible(serializable = true) +-@SuppressWarnings({"unchecked", "rawtypes"}) // TODO(kevinb): the right way to explain this?? ++@SuppressWarnings({"rawtypes", "unchecked"}) // TODO(kevinb): the right way to explain this?? + @ElementTypesAreNonnullByDefault + final class NaturalOrdering extends Ordering> implements Serializable { + static final NaturalOrdering INSTANCE = new NaturalOrdering(); +diff --git a/guava/src/com/google/common/collect/NullnessCasts.java b/guava/src/com/google/common/collect/NullnessCasts.java +index 4f894dbd31..a59d66c70c 100644 +--- a/guava/src/com/google/common/collect/NullnessCasts.java ++++ b/guava/src/com/google/common/collect/NullnessCasts.java +@@ -57,9 +57,9 @@ final class NullnessCasts { + } + + /** Returns {@code null} as any type, even one that does not include {@code null}. */ +- @SuppressWarnings({"nullness", "TypeParameterUnusedInFormals", "ReturnMissingNullable"}) +- // The warnings are legitimate. Each time we use this method, we document why. + @ParametricNullness ++ // The warnings are legitimate. Each time we use this method, we document why. ++ @SuppressWarnings({"nullness", "ReturnMissingNullable", "TypeParameterUnusedInFormals"}) + static T unsafeNull() { + return null; + } +diff --git a/guava/src/com/google/common/collect/NullsFirstOrdering.java b/guava/src/com/google/common/collect/NullsFirstOrdering.java +index ce8be2fa3c..e6c69349ae 100644 +--- a/guava/src/com/google/common/collect/NullsFirstOrdering.java ++++ b/guava/src/com/google/common/collect/NullsFirstOrdering.java +@@ -53,8 +53,8 @@ final class NullsFirstOrdering extends Ordering<@Nul + return ordering.reverse().nullsLast(); + } + +- @SuppressWarnings("unchecked") // still need the right way to explain this +- @Override ++ @Override // still need the right way to explain this ++ @SuppressWarnings("unchecked") + public Ordering<@Nullable S> nullsFirst() { + return (Ordering<@Nullable S>) this; + } +diff --git a/guava/src/com/google/common/collect/NullsLastOrdering.java b/guava/src/com/google/common/collect/NullsLastOrdering.java +index 6f8f74cdd6..6665d598d6 100644 +--- a/guava/src/com/google/common/collect/NullsLastOrdering.java ++++ b/guava/src/com/google/common/collect/NullsLastOrdering.java +@@ -58,8 +58,8 @@ final class NullsLastOrdering extends Ordering<@Null + return ordering.nullsFirst(); + } + +- @SuppressWarnings("unchecked") // still need the right way to explain this +- @Override ++ @Override // still need the right way to explain this ++ @SuppressWarnings("unchecked") + public Ordering<@Nullable S> nullsLast() { + return (Ordering<@Nullable S>) this; + } +diff --git a/guava/src/com/google/common/collect/Ordering.java b/guava/src/com/google/common/collect/Ordering.java +index 4f52e7b547..c8915b6bbb 100644 +--- a/guava/src/com/google/common/collect/Ordering.java ++++ b/guava/src/com/google/common/collect/Ordering.java +@@ -18,6 +18,8 @@ package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; ++import static java.util.Collections.emptyList; ++import static java.util.Collections.unmodifiableList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.VisibleForTesting; +@@ -191,8 +193,8 @@ public abstract class Ordering implements Comparator + * + * @deprecated no need to use this + */ +- @GwtCompatible(serializable = true) + @Deprecated ++ @GwtCompatible(serializable = true) + public static Ordering from(Ordering ordering) { + return checkNotNull(ordering); + } +@@ -746,7 +748,7 @@ public abstract class Ordering implements Comparator + if (array.length > k) { + array = Arrays.copyOf(array, k); + } +- return Collections.unmodifiableList(Arrays.asList(array)); ++ return unmodifiableList(Arrays.asList(array)); + } + } + return leastOf(iterable.iterator(), k); +@@ -773,7 +775,7 @@ public abstract class Ordering implements Comparator + checkNonnegative(k, "k"); + + if (k == 0 || !iterator.hasNext()) { +- return Collections.emptyList(); ++ return emptyList(); + } else if (k >= Integer.MAX_VALUE / 2) { + // k is really large; just do a straightforward sorted-copy-and-sublist + ArrayList list = Lists.newArrayList(iterator); +@@ -782,7 +784,7 @@ public abstract class Ordering implements Comparator + list.subList(k, list.size()).clear(); + } + list.trimToSize(); +- return Collections.unmodifiableList(list); ++ return unmodifiableList(list); + } else { + TopKSelector selector = TopKSelector.least(k, this); + selector.offerAll(iterator); +diff --git a/guava/src/com/google/common/collect/Queues.java b/guava/src/com/google/common/collect/Queues.java +index a140102fd6..7085a13a46 100644 +--- a/guava/src/com/google/common/collect/Queues.java ++++ b/guava/src/com/google/common/collect/Queues.java +@@ -14,10 +14,11 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.ArrayDeque; + import java.util.Collection; +@@ -303,7 +304,7 @@ public final class Queues { + long timeout, + TimeUnit unit) + throws InterruptedException { +- Preconditions.checkNotNull(buffer); ++ checkNotNull(buffer); + /* + * This code performs one System.nanoTime() more than necessary, and in return, the time to + * execute Queue#drainTo is not added *on top* of waiting for the timeout (which could make +@@ -375,7 +376,7 @@ public final class Queues { + int numElements, + long timeout, + TimeUnit unit) { +- Preconditions.checkNotNull(buffer); ++ checkNotNull(buffer); + long deadline = System.nanoTime() + unit.toNanos(timeout); + int added = 0; + boolean interrupted = false; +diff --git a/guava/src/com/google/common/collect/RegularContiguousSet.java b/guava/src/com/google/common/collect/RegularContiguousSet.java +index 787606eb1f..eb73336368 100644 +--- a/guava/src/com/google/common/collect/RegularContiguousSet.java ++++ b/guava/src/com/google/common/collect/RegularContiguousSet.java +@@ -83,8 +83,8 @@ final class RegularContiguousSet extends ContiguousSet + return new AbstractSequentialIterator(first()) { + final C last = last(); + +- @Override + @CheckForNull ++ @Override + protected C computeNext(C previous) { + return equalsOrThrow(previous, last) ? null : domain.next(previous); + } +@@ -97,8 +97,8 @@ final class RegularContiguousSet extends ContiguousSet + return new AbstractSequentialIterator(last()) { + final C first = first(); + +- @Override + @CheckForNull ++ @Override + protected C computeNext(C previous) { + return equalsOrThrow(previous, first) ? null : domain.previous(previous); + } +diff --git a/guava/src/com/google/common/collect/RegularImmutableAsList.java b/guava/src/com/google/common/collect/RegularImmutableAsList.java +index 0e3fe4ec8f..ab376bae7a 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableAsList.java ++++ b/guava/src/com/google/common/collect/RegularImmutableAsList.java +@@ -53,8 +53,8 @@ class RegularImmutableAsList extends ImmutableAsList { + return delegateList; + } + +- @SuppressWarnings("unchecked") // safe covariant cast! +- @Override ++ @Override // safe covariant cast! ++ @SuppressWarnings("unchecked") + public UnmodifiableListIterator listIterator(int index) { + return (UnmodifiableListIterator) delegateList.listIterator(index); + } +@@ -71,8 +71,8 @@ class RegularImmutableAsList extends ImmutableAsList { + return delegateList.copyIntoArray(dst, offset); + } + +- @Override + @CheckForNull ++ @Override + Object[] internalArray() { + return delegateList.internalArray(); + } +diff --git a/guava/src/com/google/common/collect/RegularImmutableBiMap.java b/guava/src/com/google/common/collect/RegularImmutableBiMap.java +index b8bca95804..55256d309c 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableBiMap.java ++++ b/guava/src/com/google/common/collect/RegularImmutableBiMap.java +@@ -141,8 +141,8 @@ class RegularImmutableBiMap extends ImmutableBiMap { + } + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return RegularImmutableMap.get(key, keyTable, mask); + } +@@ -216,8 +216,8 @@ class RegularImmutableBiMap extends ImmutableBiMap { + RegularImmutableBiMap.this.forEach((k, v) -> action.accept(v, k)); + } + +- @Override + @CheckForNull ++ @Override + public K get(@CheckForNull Object value) { + if (value == null || valueTable == null) { + return null; +diff --git a/guava/src/com/google/common/collect/RegularImmutableList.java b/guava/src/com/google/common/collect/RegularImmutableList.java +index 397147d70d..8c54eb983b 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableList.java ++++ b/guava/src/com/google/common/collect/RegularImmutableList.java +@@ -77,8 +77,8 @@ class RegularImmutableList extends ImmutableList { + return (E) array[index]; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public UnmodifiableListIterator listIterator(int index) { + // for performance + // The fake cast to E is safe because the creation methods only allow E's +diff --git a/guava/src/com/google/common/collect/RegularImmutableMap.java b/guava/src/com/google/common/collect/RegularImmutableMap.java +index f0f2031b94..0297cefdc1 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableMap.java ++++ b/guava/src/com/google/common/collect/RegularImmutableMap.java +@@ -252,8 +252,8 @@ final class RegularImmutableMap extends ImmutableMap { + + static class BucketOverflowException extends Exception {} + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return get(key, table, mask); + } +diff --git a/guava/src/com/google/common/collect/RegularImmutableMultiset.java b/guava/src/com/google/common/collect/RegularImmutableMultiset.java +index 47dffa1772..da0f88e747 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableMultiset.java ++++ b/guava/src/com/google/common/collect/RegularImmutableMultiset.java +@@ -42,14 +42,14 @@ class RegularImmutableMultiset extends ImmutableMultiset { + + static ImmutableMultiset create(Collection> entries) { + int distinct = entries.size(); +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableEntry[] entryArray = new ImmutableEntry[distinct]; + if (distinct == 0) { + return new RegularImmutableMultiset<>(entryArray, EMPTY_ARRAY, 0, 0, ImmutableSet.of()); + } + int tableSize = Hashing.closedTableSize(distinct, MAX_LOAD_FACTOR); + int mask = tableSize - 1; +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + @Nullable ImmutableEntry[] hashTable = new @Nullable ImmutableEntry[tableSize]; + + int index = 0; +diff --git a/guava/src/com/google/common/collect/RegularImmutableSortedMultiset.java b/guava/src/com/google/common/collect/RegularImmutableSortedMultiset.java +index 4b7ba87427..2e29d395e8 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableSortedMultiset.java ++++ b/guava/src/com/google/common/collect/RegularImmutableSortedMultiset.java +@@ -76,14 +76,14 @@ final class RegularImmutableSortedMultiset extends ImmutableSortedMultiset + } + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return isEmpty() ? null : getEntry(0); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return isEmpty() ? null : getEntry(length - 1); + } +diff --git a/guava/src/com/google/common/collect/RegularImmutableSortedSet.java b/guava/src/com/google/common/collect/RegularImmutableSortedSet.java +index fa17e67916..752b7c8ddd 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableSortedSet.java ++++ b/guava/src/com/google/common/collect/RegularImmutableSortedSet.java +@@ -17,6 +17,7 @@ + package com.google.common.collect; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.binarySearch; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +@@ -39,7 +40,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; + * @author Louis Wasserman + */ + @GwtCompatible(serializable = true, emulated = true) +-@SuppressWarnings({"serial", "rawtypes"}) ++@SuppressWarnings({"rawtypes", "serial"}) + @ElementTypesAreNonnullByDefault + final class RegularImmutableSortedSet extends ImmutableSortedSet { + static final RegularImmutableSortedSet NATURAL_EMPTY_SET = +@@ -52,8 +53,8 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + this.elements = elements; + } + +- @Override + @CheckForNull ++ @Override + Object[] internalArray() { + return elements.internalArray(); + } +@@ -156,7 +157,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + } + + private int unsafeBinarySearch(Object key) throws ClassCastException { +- return Collections.binarySearch(elements, key, unsafeComparator()); ++ return binarySearch(elements, key, unsafeComparator()); + } + + @Override +@@ -222,29 +223,29 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + return elements.get(size() - 1); + } + +- @Override + @CheckForNull ++ @Override + public E lower(E element) { + int index = headIndex(element, false) - 1; + return (index == -1) ? null : elements.get(index); + } + +- @Override + @CheckForNull ++ @Override + public E floor(E element) { + int index = headIndex(element, true) - 1; + return (index == -1) ? null : elements.get(index); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(E element) { + int index = tailIndex(element, true); + return (index == size()) ? null : elements.get(index); + } + +- @Override + @CheckForNull ++ @Override + public E higher(E element) { + int index = tailIndex(element, false); + return (index == size()) ? null : elements.get(index); +@@ -256,7 +257,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + } + + int headIndex(E toElement, boolean inclusive) { +- int index = Collections.binarySearch(elements, checkNotNull(toElement), comparator()); ++ int index = binarySearch(elements, checkNotNull(toElement), comparator()); + if (index >= 0) { + return inclusive ? index + 1 : index; + } else { +@@ -276,7 +277,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + } + + int tailIndex(E fromElement, boolean inclusive) { +- int index = Collections.binarySearch(elements, checkNotNull(fromElement), comparator()); ++ int index = binarySearch(elements, checkNotNull(fromElement), comparator()); + if (index >= 0) { + return inclusive ? index : index + 1; + } else { +@@ -310,7 +311,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + } + int position; + try { +- position = Collections.binarySearch(elements, target, unsafeComparator()); ++ position = binarySearch(elements, target, unsafeComparator()); + } catch (ClassCastException e) { + return -1; + } +diff --git a/guava/src/com/google/common/collect/ReverseNaturalOrdering.java b/guava/src/com/google/common/collect/ReverseNaturalOrdering.java +index f0c40cb612..66d5dc8c4f 100644 +--- a/guava/src/com/google/common/collect/ReverseNaturalOrdering.java ++++ b/guava/src/com/google/common/collect/ReverseNaturalOrdering.java +@@ -24,7 +24,7 @@ import java.util.Iterator; + + /** An ordering that uses the reverse of the natural order of the values. */ + @GwtCompatible(serializable = true) +-@SuppressWarnings({"unchecked", "rawtypes"}) // TODO(kevinb): the right way to explain this?? ++@SuppressWarnings({"rawtypes", "unchecked"}) // TODO(kevinb): the right way to explain this?? + @ElementTypesAreNonnullByDefault + final class ReverseNaturalOrdering extends Ordering> implements Serializable { + static final ReverseNaturalOrdering INSTANCE = new ReverseNaturalOrdering(); +diff --git a/guava/src/com/google/common/collect/ReverseOrdering.java b/guava/src/com/google/common/collect/ReverseOrdering.java +index 6c1e74dd73..07505bbd9e 100644 +--- a/guava/src/com/google/common/collect/ReverseOrdering.java ++++ b/guava/src/com/google/common/collect/ReverseOrdering.java +@@ -40,8 +40,8 @@ final class ReverseOrdering extends Ordering + return forwardOrder.compare(b, a); + } + +- @SuppressWarnings("unchecked") // how to explain? +- @Override ++ @Override // how to explain? ++ @SuppressWarnings("unchecked") + public Ordering reverse() { + return (Ordering) forwardOrder; + } +diff --git a/guava/src/com/google/common/collect/Sets.java b/guava/src/com/google/common/collect/Sets.java +index abb6558910..1d600e684a 100644 +--- a/guava/src/com/google/common/collect/Sets.java ++++ b/guava/src/com/google/common/collect/Sets.java +@@ -19,6 +19,8 @@ package com.google.common.collect; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.CollectPreconditions.checkNonnegative; ++import static java.util.Collections.disjoint; ++import static java.util.Collections.unmodifiableSortedSet; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -593,8 +595,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean add(@ParametricNullness E e) { + throw new UnsupportedOperationException(); + } +@@ -607,8 +609,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean remove(@CheckForNull Object object) { + throw new UnsupportedOperationException(); + } +@@ -621,8 +623,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean addAll(Collection newElements) { + throw new UnsupportedOperationException(); + } +@@ -635,8 +637,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean removeAll(Collection oldElements) { + throw new UnsupportedOperationException(); + } +@@ -649,8 +651,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean removeIf(java.util.function.Predicate filter) { + throw new UnsupportedOperationException(); + } +@@ -663,8 +665,8 @@ public final class Sets { + */ + @CanIgnoreReturnValue + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final boolean retainAll(Collection elementsToKeep) { + throw new UnsupportedOperationException(); + } +@@ -676,8 +678,8 @@ public final class Sets { + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void clear() { + throw new UnsupportedOperationException(); + } +@@ -729,8 +731,8 @@ public final class Sets { + final Iterator itr1 = set1.iterator(); + final Iterator itr2 = set2.iterator(); + +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + if (itr1.hasNext()) { + return itr1.next(); +@@ -814,8 +816,8 @@ public final class Sets { + return new AbstractIterator() { + final Iterator itr = set1.iterator(); + +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + while (itr.hasNext()) { + E e = itr.next(); +@@ -851,7 +853,7 @@ public final class Sets { + + @Override + public boolean isEmpty() { +- return Collections.disjoint(set2, set1); ++ return disjoint(set2, set1); + } + + @Override +@@ -887,8 +889,8 @@ public final class Sets { + return new AbstractIterator() { + final Iterator itr = set1.iterator(); + +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + while (itr.hasNext()) { + E e = itr.next(); +@@ -956,8 +958,8 @@ public final class Sets { + final Iterator itr1 = set1.iterator(); + final Iterator itr2 = set2.iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + public E computeNext() { + while (itr1.hasNext()) { + E elem1 = itr1.next(); +@@ -1147,8 +1149,8 @@ public final class Sets { + super(unfiltered, predicate); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return ((SortedSet) unfiltered).comparator(); + } +@@ -1200,38 +1202,38 @@ public final class Sets { + return (NavigableSet) unfiltered; + } + +- @Override + @CheckForNull ++ @Override + public E lower(@ParametricNullness E e) { + return Iterators.find(unfiltered().headSet(e, false).descendingIterator(), predicate, null); + } + +- @Override + @CheckForNull ++ @Override + public E floor(@ParametricNullness E e) { + return Iterators.find(unfiltered().headSet(e, true).descendingIterator(), predicate, null); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(@ParametricNullness E e) { + return Iterables.find(unfiltered().tailSet(e, true), predicate, null); + } + +- @Override + @CheckForNull ++ @Override + public E higher(@ParametricNullness E e) { + return Iterables.find(unfiltered().tailSet(e, false), predicate, null); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + return Iterables.removeFirstMatching(unfiltered(), predicate); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + return Iterables.removeFirstMatching(unfiltered().descendingSet(), predicate); + } +@@ -1671,8 +1673,8 @@ public final class Sets { + return new AbstractIterator>() { + final BitSet bits = new BitSet(index.size()); + +- @Override + @CheckForNull ++ @Override + protected Set computeNext() { + if (bits.isEmpty()) { + bits.set(0, size); +@@ -1714,8 +1716,8 @@ public final class Sets { + return new AbstractIterator() { + int i = -1; + +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + i = copy.nextSetBit(i + 1); + if (i == -1) { +@@ -1804,7 +1806,7 @@ public final class Sets { + + UnmodifiableNavigableSet(NavigableSet delegate) { + this.delegate = checkNotNull(delegate); +- this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate); ++ this.unmodifiableDelegate = unmodifiableSortedSet(delegate); + } + + @Override +@@ -1834,38 +1836,38 @@ public final class Sets { + delegate.forEach(action); + } + +- @Override + @CheckForNull ++ @Override + public E lower(@ParametricNullness E e) { + return delegate.lower(e); + } + +- @Override + @CheckForNull ++ @Override + public E floor(@ParametricNullness E e) { + return delegate.floor(e); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(@ParametricNullness E e) { + return delegate.ceiling(e); + } + +- @Override + @CheckForNull ++ @Override + public E higher(@ParametricNullness E e) { + return delegate.higher(e); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + throw new UnsupportedOperationException(); + } +@@ -2002,38 +2004,38 @@ public final class Sets { + return forward; + } + +- @Override + @CheckForNull ++ @Override + public E lower(@ParametricNullness E e) { + return forward.higher(e); + } + +- @Override + @CheckForNull ++ @Override + public E floor(@ParametricNullness E e) { + return forward.ceiling(e); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(@ParametricNullness E e) { + return forward.floor(e); + } + +- @Override + @CheckForNull ++ @Override + public E higher(@ParametricNullness E e) { + return forward.lower(e); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + return forward.pollLast(); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + return forward.pollFirst(); + } +@@ -2082,8 +2084,8 @@ public final class Sets { + return standardTailSet(fromElement); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Comparator comparator() { + Comparator forwardComparator = forward.comparator(); + if (forwardComparator == null) { +diff --git a/guava/src/com/google/common/collect/SingletonImmutableBiMap.java b/guava/src/com/google/common/collect/SingletonImmutableBiMap.java +index c5fb2b2989..b3f9af784c 100644 +--- a/guava/src/com/google/common/collect/SingletonImmutableBiMap.java ++++ b/guava/src/com/google/common/collect/SingletonImmutableBiMap.java +@@ -52,8 +52,8 @@ final class SingletonImmutableBiMap extends ImmutableBiMap { + this.inverse = inverse; + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return singleKey.equals(key) ? singleValue : null; + } +diff --git a/guava/src/com/google/common/collect/SingletonImmutableList.java b/guava/src/com/google/common/collect/SingletonImmutableList.java +index a7ac8b30e2..29f6da2c46 100644 +--- a/guava/src/com/google/common/collect/SingletonImmutableList.java ++++ b/guava/src/com/google/common/collect/SingletonImmutableList.java +@@ -16,11 +16,12 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.singleton; + + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; +-import java.util.Collections; + import java.util.Spliterator; + + /** +@@ -41,7 +42,7 @@ final class SingletonImmutableList extends ImmutableList { + + @Override + public E get(int index) { +- Preconditions.checkElementIndex(index, 1); ++ checkElementIndex(index, 1); + return element; + } + +@@ -52,7 +53,7 @@ final class SingletonImmutableList extends ImmutableList { + + @Override + public Spliterator spliterator() { +- return Collections.singleton(element).spliterator(); ++ return singleton(element).spliterator(); + } + + @Override +@@ -62,7 +63,7 @@ final class SingletonImmutableList extends ImmutableList { + + @Override + public ImmutableList subList(int fromIndex, int toIndex) { +- Preconditions.checkPositionIndexes(fromIndex, toIndex, 1); ++ checkPositionIndexes(fromIndex, toIndex, 1); + return (fromIndex == toIndex) ? ImmutableList.of() : this; + } + +diff --git a/guava/src/com/google/common/collect/SingletonImmutableSet.java b/guava/src/com/google/common/collect/SingletonImmutableSet.java +index 088cb802f2..c9b05a0430 100644 +--- a/guava/src/com/google/common/collect/SingletonImmutableSet.java ++++ b/guava/src/com/google/common/collect/SingletonImmutableSet.java +@@ -16,8 +16,9 @@ + + package com.google.common.collect; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import javax.annotation.CheckForNull; + import org.checkerframework.checker.nullness.qual.Nullable; + +@@ -37,7 +38,7 @@ final class SingletonImmutableSet extends ImmutableSet { + final transient E element; + + SingletonImmutableSet(E element) { +- this.element = Preconditions.checkNotNull(element); ++ this.element = checkNotNull(element); + } + + @Override +diff --git a/guava/src/com/google/common/collect/SortedMultisets.java b/guava/src/com/google/common/collect/SortedMultisets.java +index f602a42a11..20ea66a033 100644 +--- a/guava/src/com/google/common/collect/SortedMultisets.java ++++ b/guava/src/com/google/common/collect/SortedMultisets.java +@@ -102,26 +102,26 @@ final class SortedMultisets { + super(multiset); + } + +- @Override + @CheckForNull ++ @Override + public E lower(@ParametricNullness E e) { + return getElementOrNull(multiset().headMultiset(e, OPEN).lastEntry()); + } + +- @Override + @CheckForNull ++ @Override + public E floor(@ParametricNullness E e) { + return getElementOrNull(multiset().headMultiset(e, CLOSED).lastEntry()); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(@ParametricNullness E e) { + return getElementOrNull(multiset().tailMultiset(e, CLOSED).firstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public E higher(@ParametricNullness E e) { + return getElementOrNull(multiset().tailMultiset(e, OPEN).firstEntry()); + } +@@ -136,14 +136,14 @@ final class SortedMultisets { + return descendingSet().iterator(); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + return getElementOrNull(multiset().pollFirstEntry()); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + return getElementOrNull(multiset().pollLastEntry()); + } +diff --git a/guava/src/com/google/common/collect/SparseImmutableTable.java b/guava/src/com/google/common/collect/SparseImmutableTable.java +index 44881fde7f..2105b7965b 100644 +--- a/guava/src/com/google/common/collect/SparseImmutableTable.java ++++ b/guava/src/com/google/common/collect/SparseImmutableTable.java +@@ -24,7 +24,7 @@ import java.util.Map.Entry; + + /** A {@code RegularImmutableTable} optimized for sparse data. */ + @GwtCompatible +-@Immutable(containerOf = {"R", "C", "V"}) ++@Immutable(containerOf = {"C", "R", "V"}) + @ElementTypesAreNonnullByDefault + final class SparseImmutableTable extends RegularImmutableTable { + static final ImmutableTable EMPTY = +diff --git a/guava/src/com/google/common/collect/StandardRowSortedTable.java b/guava/src/com/google/common/collect/StandardRowSortedTable.java +index bea5b7bb3a..6da2770de5 100644 +--- a/guava/src/com/google/common/collect/StandardRowSortedTable.java ++++ b/guava/src/com/google/common/collect/StandardRowSortedTable.java +@@ -103,8 +103,8 @@ class StandardRowSortedTable extends StandardTable + return new Maps.SortedKeySet<>(this); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + return sortedBackingMap().comparator(); + } +diff --git a/guava/src/com/google/common/collect/StandardTable.java b/guava/src/com/google/common/collect/StandardTable.java +index 06defb0eb8..a2ac961bcb 100644 +--- a/guava/src/com/google/common/collect/StandardTable.java ++++ b/guava/src/com/google/common/collect/StandardTable.java +@@ -106,8 +106,8 @@ class StandardTable extends AbstractTable implements Serializa + return value != null && super.containsValue(value); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return (rowKey == null || columnKey == null) ? null : super.get(rowKey, columnKey); + } +@@ -143,8 +143,8 @@ class StandardTable extends AbstractTable implements Serializa + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V put(R rowKey, C columnKey, V value) { + checkNotNull(rowKey); + checkNotNull(columnKey); +@@ -153,8 +153,8 @@ class StandardTable extends AbstractTable implements Serializa + } + + @CanIgnoreReturnValue +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + if ((rowKey == null) || (columnKey == null)) { + return null; +@@ -348,15 +348,15 @@ class StandardTable extends AbstractTable implements Serializa + return (key != null && backingRowMap != null) && Maps.safeContainsKey(backingRowMap, key); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + updateBackingRowMapField(); + return (key != null && backingRowMap != null) ? Maps.safeGet(backingRowMap, key) : null; + } + +- @Override + @CheckForNull ++ @Override + public V put(C key, V value) { + checkNotNull(key); + checkNotNull(value); +@@ -366,8 +366,8 @@ class StandardTable extends AbstractTable implements Serializa + return StandardTable.this.put(rowKey, key, value); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + updateBackingRowMapField(); + if (backingRowMap == null) { +@@ -466,14 +466,14 @@ class StandardTable extends AbstractTable implements Serializa + this.columnKey = checkNotNull(columnKey); + } + +- @Override + @CheckForNull ++ @Override + public V put(R key, V value) { + return StandardTable.this.put(key, columnKey, value); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + return StandardTable.this.get(key, columnKey); + } +@@ -483,8 +483,8 @@ class StandardTable extends AbstractTable implements Serializa + return StandardTable.this.contains(key, columnKey); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + return StandardTable.this.remove(key, columnKey); + } +@@ -569,8 +569,8 @@ class StandardTable extends AbstractTable implements Serializa + private class EntrySetIterator extends AbstractIterator> { + final Iterator>> iterator = backingMap.entrySet().iterator(); + +- @Override + @CheckForNull ++ @Override + protected Entry computeNext() { + while (iterator.hasNext()) { + final Entry> entry = iterator.next(); +@@ -775,8 +775,8 @@ class StandardTable extends AbstractTable implements Serializa + final Iterator> mapIterator = backingMap.values().iterator(); + Iterator> entryIterator = Iterators.emptyIterator(); + +- @Override + @CheckForNull ++ @Override + protected C computeNext() { + while (true) { + if (entryIterator.hasNext()) { +@@ -825,16 +825,16 @@ class StandardTable extends AbstractTable implements Serializa + } + + // performing cast only when key is in backing map and has the correct type +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public Map get(@CheckForNull Object key) { + // requireNonNull is safe because of the containsRow check. + return containsRow(key) ? row((R) requireNonNull(key)) : null; + } + +- @Override + @CheckForNull ++ @Override + public Map remove(@CheckForNull Object key) { + return (key == null) ? null : backingMap.remove(key); + } +@@ -899,9 +899,9 @@ class StandardTable extends AbstractTable implements Serializa + private class ColumnMap extends ViewCachingAbstractMap> { + // The cast to C occurs only when the key is in the map, implying that it + // has the correct type. +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public Map get(@CheckForNull Object key) { + // requireNonNull is safe because of the containsColumn check. + return containsColumn(key) ? column((C) requireNonNull(key)) : null; +@@ -912,8 +912,8 @@ class StandardTable extends AbstractTable implements Serializa + return containsColumn(key); + } + +- @Override + @CheckForNull ++ @Override + public Map remove(@CheckForNull Object key) { + return containsColumn(key) ? removeColumn(key) : null; + } +diff --git a/guava/src/com/google/common/collect/Streams.java b/guava/src/com/google/common/collect/Streams.java +index cd7a07c342..fcaf09d138 100644 +--- a/guava/src/com/google/common/collect/Streams.java ++++ b/guava/src/com/google/common/collect/Streams.java +@@ -752,8 +752,8 @@ public final class Streams { + + abstract S createSplit(F from, long i); + +- @Override + @CheckForNull ++ @Override + public S trySplit() { + Spliterator splitOrNull = fromSpliterator.trySplit(); + if (splitOrNull == null) { +diff --git a/guava/src/com/google/common/collect/Synchronized.java b/guava/src/com/google/common/collect/Synchronized.java +index 29fe61a89b..5514a253fc 100644 +--- a/guava/src/com/google/common/collect/Synchronized.java ++++ b/guava/src/com/google/common/collect/Synchronized.java +@@ -126,8 +126,8 @@ final class Synchronized { + super(delegate, mutex); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Collection delegate() { + return (Collection) super.delegate(); + } +@@ -313,8 +313,8 @@ final class Synchronized { + return (SortedSet) super.delegate(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + synchronized (mutex) { + return delegate().comparator(); +@@ -599,8 +599,8 @@ final class Synchronized { + @CheckForNull transient Map> asMap; + @CheckForNull transient Multiset keys; + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Multimap delegate() { + return (Multimap) super.delegate(); + } +@@ -919,8 +919,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public Comparator valueComparator() { + synchronized (mutex) { + return delegate().valueComparator(); +@@ -1071,8 +1071,8 @@ final class Synchronized { + super(delegate, mutex); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Map delegate() { + return (Map) super.delegate(); + } +@@ -1115,16 +1115,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object key) { + synchronized (mutex) { + return delegate().get(key); + } + } + +- @Override + @CheckForNull ++ @Override + public V getOrDefault(@CheckForNull Object key, @CheckForNull V defaultValue) { + synchronized (mutex) { + return delegate().getOrDefault(key, defaultValue); +@@ -1148,16 +1148,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V put(K key, V value) { + synchronized (mutex) { + return delegate().put(key, value); + } + } + +- @Override + @CheckForNull ++ @Override + public V putIfAbsent(K key, V value) { + synchronized (mutex) { + return delegate().putIfAbsent(key, value); +@@ -1171,8 +1171,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V replace(K key, V value) { + synchronized (mutex) { + return delegate().replace(key, value); +@@ -1224,8 +1224,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object key) { + synchronized (mutex) { + return delegate().remove(key); +@@ -1293,8 +1293,8 @@ final class Synchronized { + return (SortedMap) super.delegate(); + } + +- @Override + @CheckForNull ++ @Override + public Comparator comparator() { + synchronized (mutex) { + return delegate().comparator(); +@@ -1374,8 +1374,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V forcePut(K key, V value) { + synchronized (mutex) { + return delegate().forcePut(key, value); +@@ -1404,8 +1404,8 @@ final class Synchronized { + super(delegate, mutex); + } + +- @Override + @CheckForNull ++ @Override + public Collection get(@CheckForNull Object key) { + synchronized (mutex) { + Collection collection = super.get(key); +@@ -1475,8 +1475,8 @@ final class Synchronized { + return (NavigableSet) super.delegate(); + } + +- @Override + @CheckForNull ++ @Override + public E ceiling(E e) { + synchronized (mutex) { + return delegate().ceiling(e); +@@ -1502,8 +1502,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public E floor(E e) { + synchronized (mutex) { + return delegate().floor(e); +@@ -1522,32 +1522,32 @@ final class Synchronized { + return headSet(toElement, false); + } + +- @Override + @CheckForNull ++ @Override + public E higher(E e) { + synchronized (mutex) { + return delegate().higher(e); + } + } + +- @Override + @CheckForNull ++ @Override + public E lower(E e) { + synchronized (mutex) { + return delegate().lower(e); + } + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + synchronized (mutex) { + return delegate().pollFirst(); + } + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + synchronized (mutex) { + return delegate().pollLast(); +@@ -1620,16 +1620,16 @@ final class Synchronized { + return (NavigableMap) super.delegate(); + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry ceilingEntry(K key) { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().ceilingEntry(key), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public K ceilingKey(K key) { + synchronized (mutex) { + return delegate().ceilingKey(key); +@@ -1660,24 +1660,24 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry firstEntry() { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().firstEntry(), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry floorEntry(K key) { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().floorEntry(key), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public K floorKey(K key) { + synchronized (mutex) { + return delegate().floorKey(key); +@@ -1696,40 +1696,40 @@ final class Synchronized { + return headMap(toKey, false); + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry higherEntry(K key) { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().higherEntry(key), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public K higherKey(K key) { + synchronized (mutex) { + return delegate().higherKey(key); + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry lastEntry() { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().lastEntry(), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry lowerEntry(K key) { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().lowerEntry(key), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public K lowerKey(K key) { + synchronized (mutex) { + return delegate().lowerKey(key); +@@ -1753,16 +1753,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry pollFirstEntry() { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().pollFirstEntry(), mutex); + } + } + +- @Override + @CheckForNull ++ @Override + public Map.Entry pollLastEntry() { + synchronized (mutex) { + return nullableSynchronizedEntry(delegate().pollLastEntry(), mutex); +@@ -1797,8 +1797,8 @@ final class Synchronized { + private static final long serialVersionUID = 0; + } + +- @GwtIncompatible // works but is needed only for NavigableMap +- @CheckForNull ++ @CheckForNull // works but is needed only for NavigableMap ++ @GwtIncompatible + private static + Map.Entry nullableSynchronizedEntry( + @CheckForNull Map.Entry entry, @CheckForNull Object mutex) { +@@ -1816,8 +1816,8 @@ final class Synchronized { + super(delegate, mutex); + } + +- @SuppressWarnings("unchecked") // guaranteed by the constructor +- @Override ++ @Override // guaranteed by the constructor ++ @SuppressWarnings("unchecked") + Map.Entry delegate() { + return (Map.Entry) super.delegate(); + } +@@ -1890,16 +1890,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public E peek() { + synchronized (mutex) { + return delegate().peek(); + } + } + +- @Override + @CheckForNull ++ @Override + public E poll() { + synchronized (mutex) { + return delegate().poll(); +@@ -1974,16 +1974,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst() { + synchronized (mutex) { + return delegate().pollFirst(); + } + } + +- @Override + @CheckForNull ++ @Override + public E pollLast() { + synchronized (mutex) { + return delegate().pollLast(); +@@ -2004,16 +2004,16 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public E peekFirst() { + synchronized (mutex) { + return delegate().peekFirst(); + } + } + +- @Override + @CheckForNull ++ @Override + public E peekLast() { + synchronized (mutex) { + return delegate().peekLast(); +@@ -2071,8 +2071,8 @@ final class Synchronized { + super(delegate, mutex); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Table delegate() { + return (Table) super.delegate(); + } +@@ -2105,8 +2105,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + synchronized (mutex) { + return delegate().get(rowKey, columnKey); +@@ -2134,8 +2134,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V put(R rowKey, C columnKey, V value) { + synchronized (mutex) { + return delegate().put(rowKey, columnKey, value); +@@ -2149,8 +2149,8 @@ final class Synchronized { + } + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + synchronized (mutex) { + return delegate().remove(rowKey, columnKey); +diff --git a/guava/src/com/google/common/collect/Tables.java b/guava/src/com/google/common/collect/Tables.java +index 9c58611d41..d5c32c08ff 100644 +--- a/guava/src/com/google/common/collect/Tables.java ++++ b/guava/src/com/google/common/collect/Tables.java +@@ -19,6 +19,11 @@ package com.google.common.collect; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableCollection; ++import static java.util.Collections.unmodifiableMap; ++import static java.util.Collections.unmodifiableSet; ++import static java.util.Collections.unmodifiableSortedMap; ++import static java.util.Collections.unmodifiableSortedSet; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -28,7 +33,6 @@ import com.google.common.base.Supplier; + import com.google.common.collect.Table.Cell; + import java.io.Serializable; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.Map; + import java.util.Set; +@@ -265,14 +269,14 @@ public final class Tables { + return original.containsValue(value); + } + +- @Override + @CheckForNull ++ @Override + public V get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return original.get(columnKey, rowKey); + } + +- @Override + @CheckForNull ++ @Override + public V put( + @ParametricNullness C rowKey, + @ParametricNullness R columnKey, +@@ -285,8 +289,8 @@ public final class Tables { + original.putAll(transpose(table)); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return original.remove(columnKey, rowKey); + } +@@ -325,14 +329,14 @@ public final class Tables { + } + }; + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Iterator> cellIterator() { + return Iterators.transform(original.cellSet().iterator(), (Function) TRANSPOSE_CELL); + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + Spliterator> cellSpliterator() { + return CollectSpliterators.map(original.cellSet().spliterator(), (Function) TRANSPOSE_CELL); + } +@@ -436,8 +440,8 @@ public final class Tables { + return fromTable.contains(rowKey, columnKey); + } + +- @Override + @CheckForNull ++ @Override + public V2 get(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + // The function is passed a null input only when the table contains a null + // value. +@@ -457,8 +461,8 @@ public final class Tables { + fromTable.clear(); + } + +- @Override + @CheckForNull ++ @Override + public V2 put( + @ParametricNullness R rowKey, + @ParametricNullness C columnKey, +@@ -471,8 +475,8 @@ public final class Tables { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V2 remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + return contains(rowKey, columnKey) + // The cast is safe because of the contains() check. +@@ -576,15 +580,15 @@ public final class Tables { + this.delegate = checkNotNull(delegate); + } + +- @SuppressWarnings("unchecked") // safe, covariant cast +- @Override ++ @Override // safe, covariant cast ++ @SuppressWarnings("unchecked") + protected Table delegate() { + return (Table) delegate; + } + + @Override + public Set> cellSet() { +- return Collections.unmodifiableSet(super.cellSet()); ++ return unmodifiableSet(super.cellSet()); + } + + @Override +@@ -594,22 +598,22 @@ public final class Tables { + + @Override + public Map column(@ParametricNullness C columnKey) { +- return Collections.unmodifiableMap(super.column(columnKey)); ++ return unmodifiableMap(super.column(columnKey)); + } + + @Override + public Set columnKeySet() { +- return Collections.unmodifiableSet(super.columnKeySet()); ++ return unmodifiableSet(super.columnKeySet()); + } + + @Override + public Map> columnMap() { + Function, Map> wrapper = unmodifiableWrapper(); +- return Collections.unmodifiableMap(Maps.transformValues(super.columnMap(), wrapper)); ++ return unmodifiableMap(Maps.transformValues(super.columnMap(), wrapper)); + } + +- @Override + @CheckForNull ++ @Override + public V put( + @ParametricNullness R rowKey, + @ParametricNullness C columnKey, +@@ -622,31 +626,31 @@ public final class Tables { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public V remove(@CheckForNull Object rowKey, @CheckForNull Object columnKey) { + throw new UnsupportedOperationException(); + } + + @Override + public Map row(@ParametricNullness R rowKey) { +- return Collections.unmodifiableMap(super.row(rowKey)); ++ return unmodifiableMap(super.row(rowKey)); + } + + @Override + public Set rowKeySet() { +- return Collections.unmodifiableSet(super.rowKeySet()); ++ return unmodifiableSet(super.rowKeySet()); + } + + @Override + public Map> rowMap() { + Function, Map> wrapper = unmodifiableWrapper(); +- return Collections.unmodifiableMap(Maps.transformValues(super.rowMap(), wrapper)); ++ return unmodifiableMap(Maps.transformValues(super.rowMap(), wrapper)); + } + + @Override + public Collection values() { +- return Collections.unmodifiableCollection(super.values()); ++ return unmodifiableCollection(super.values()); + } + + private static final long serialVersionUID = 0; +@@ -692,12 +696,12 @@ public final class Tables { + @Override + public SortedMap> rowMap() { + Function, Map> wrapper = unmodifiableWrapper(); +- return Collections.unmodifiableSortedMap(Maps.transformValues(delegate().rowMap(), wrapper)); ++ return unmodifiableSortedMap(Maps.transformValues(delegate().rowMap(), wrapper)); + } + + @Override + public SortedSet rowKeySet() { +- return Collections.unmodifiableSortedSet(delegate().rowKeySet()); ++ return unmodifiableSortedSet(delegate().rowKeySet()); + } + + private static final long serialVersionUID = 0; +@@ -713,7 +717,7 @@ public final class Tables { + new Function, Map>() { + @Override + public Map apply(Map input) { +- return Collections.unmodifiableMap(input); ++ return unmodifiableMap(input); + } + }; + +diff --git a/guava/src/com/google/common/collect/TopKSelector.java b/guava/src/com/google/common/collect/TopKSelector.java +index 45f9ca58fb..c8e19a0884 100644 +--- a/guava/src/com/google/common/collect/TopKSelector.java ++++ b/guava/src/com/google/common/collect/TopKSelector.java +@@ -19,12 +19,12 @@ package com.google.common.collect; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT; ++import static java.util.Collections.unmodifiableList; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.math.IntMath; + import java.math.RoundingMode; + import java.util.Arrays; +-import java.util.Collections; + import java.util.Comparator; + import java.util.Iterator; + import java.util.List; +@@ -281,6 +281,6 @@ final class TopKSelector { + threshold = buffer[k - 1]; + } + // we have to support null elements, so no ImmutableList for us +- return Collections.unmodifiableList(Arrays.asList(Arrays.copyOf(buffer, bufferSize))); ++ return unmodifiableList(Arrays.asList(Arrays.copyOf(buffer, bufferSize))); + } + } +diff --git a/guava/src/com/google/common/collect/TreeBasedTable.java b/guava/src/com/google/common/collect/TreeBasedTable.java +index 9ef210a54a..68c651eba8 100644 +--- a/guava/src/com/google/common/collect/TreeBasedTable.java ++++ b/guava/src/com/google/common/collect/TreeBasedTable.java +@@ -257,8 +257,8 @@ public class TreeBasedTable extends StandardRowSortedTable { + } + } + +- @Override + @CheckForNull ++ @Override + SortedMap computeBackingRowMap() { + updateWholeRowField(); + SortedMap map = wholeRow; +@@ -289,8 +289,8 @@ public class TreeBasedTable extends StandardRowSortedTable { + return rangeContains(key) && super.containsKey(key); + } + +- @Override + @CheckForNull ++ @Override + public V put(C key, V value) { + checkArgument(rangeContains(checkNotNull(key))); + return super.put(key, value); +@@ -323,8 +323,8 @@ public class TreeBasedTable extends StandardRowSortedTable { + return new AbstractIterator() { + @CheckForNull C lastValue; + +- @Override + @CheckForNull ++ @Override + protected C computeNext() { + while (merged.hasNext()) { + C next = merged.next(); +diff --git a/guava/src/com/google/common/collect/TreeMultimap.java b/guava/src/com/google/common/collect/TreeMultimap.java +index b6adb40e8f..956e37dbd5 100644 +--- a/guava/src/com/google/common/collect/TreeMultimap.java ++++ b/guava/src/com/google/common/collect/TreeMultimap.java +@@ -164,8 +164,8 @@ public class TreeMultimap get(@ParametricNullness K key) { + return (NavigableSet) super.get(key); + } +diff --git a/guava/src/com/google/common/collect/TreeRangeMap.java b/guava/src/com/google/common/collect/TreeRangeMap.java +index 60e7bf3df8..79385fa992 100644 +--- a/guava/src/com/google/common/collect/TreeRangeMap.java ++++ b/guava/src/com/google/common/collect/TreeRangeMap.java +@@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Predicates.compose; + import static com.google.common.base.Predicates.in; + import static com.google.common.base.Predicates.not; ++import static java.util.Collections.emptyMap; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; +@@ -30,7 +31,6 @@ import com.google.common.base.Predicate; + import com.google.common.collect.Maps.IteratorBasedAbstractMap; + import java.util.AbstractMap; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; + import java.util.Map; +@@ -103,15 +103,15 @@ public final class TreeRangeMap implements RangeMap, V> entry = getEntry(key); + return (entry == null) ? null : entry.getValue(); + } + +- @Override + @CheckForNull ++ @Override + public Entry, V> getEntry(K key) { + Entry, RangeMapEntry> mapEntry = + entriesByLowerBound.floorEntry(Cut.belowValue(key)); +@@ -152,9 +152,7 @@ public final class TreeRangeMap implements RangeMap, RangeMapEntry> higherEntry = + entriesByLowerBound.floorEntry(range.upperBound); +- coalescedRange = coalesce(coalescedRange, value, higherEntry); +- +- return coalescedRange; ++ return coalesce(coalescedRange, value, higherEntry); + } + + /** Returns the range that spans the given range and entry, if the entry can be coalesced. */ +@@ -344,8 +342,8 @@ public final class TreeRangeMap implements RangeMap range = (Range) key; +@@ -385,14 +383,14 @@ public final class TreeRangeMap implements RangeMap, Object> EMPTY_SUB_RANGE_MAP = + new RangeMap, Object>() { +- @Override + @CheckForNull ++ @Override + public Object get(Comparable key) { + return null; + } + +- @Override + @CheckForNull ++ @Override + public Entry>, Object> getEntry(Comparable key) { + return null; + } +@@ -445,12 +443,12 @@ public final class TreeRangeMap implements RangeMap>, Object> asMapOfRanges() { +- return Collections.emptyMap(); ++ return emptyMap(); + } + + @Override + public Map>, Object> asDescendingMapOfRanges() { +- return Collections.emptyMap(); ++ return emptyMap(); + } + + @Override +@@ -468,14 +466,14 @@ public final class TreeRangeMap implements RangeMap, V> getEntry(K key) { + if (subRange.contains(key)) { + Entry, V> entry = TreeRangeMap.this.getEntry(key); +@@ -603,8 +601,8 @@ public final class TreeRangeMap implements RangeMap, V>>() { + +- @Override + @CheckForNull ++ @Override + protected Entry, V> computeNext() { + if (backingItr.hasNext()) { + RangeMapEntry entry = backingItr.next(); +@@ -646,8 +644,8 @@ public final class TreeRangeMap implements RangeMap implements RangeMap implements RangeMap, V>>() { + +- @Override + @CheckForNull ++ @Override + protected Entry, V> computeNext() { + while (backingItr.hasNext()) { + RangeMapEntry entry = backingItr.next(); +diff --git a/guava/src/com/google/common/collect/TreeRangeSet.java b/guava/src/com/google/common/collect/TreeRangeSet.java +index 7ba71139eb..698029322a 100644 +--- a/guava/src/com/google/common/collect/TreeRangeSet.java ++++ b/guava/src/com/google/common/collect/TreeRangeSet.java +@@ -118,8 +118,8 @@ public class TreeRangeSet> extends AbstractRangeSet + } + } + +- @Override + @CheckForNull ++ @Override + public Range rangeContaining(C value) { + checkNotNull(value); + Entry, Range> floorEntry = rangesByLowerBound.floorEntry(Cut.belowValue(value)); +@@ -341,8 +341,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return get(key) != null; + } + +- @Override + @CheckForNull ++ @Override + public Range get(@CheckForNull Object key) { + if (key instanceof Cut) { + try { +@@ -387,8 +387,8 @@ public class TreeRangeSet> extends AbstractRangeSet + } + } + return new AbstractIterator, Range>>() { +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (!backingItr.hasNext()) { + return endOfData(); +@@ -421,8 +421,8 @@ public class TreeRangeSet> extends AbstractRangeSet + backingItr.next(); + } + return new AbstractIterator, Range>>() { +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (!backingItr.hasNext()) { + return endOfData(); +@@ -542,8 +542,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return new AbstractIterator, Range>>() { + Cut nextComplementRangeLowerBound = firstComplementRangeLowerBound; + +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (complementLowerBoundWindow.upperBound.isLessThan(nextComplementRangeLowerBound) + || nextComplementRangeLowerBound == Cut.aboveAll()) { +@@ -603,8 +603,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return new AbstractIterator, Range>>() { + Cut nextComplementRangeUpperBound = firstComplementRangeUpperBound; + +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (nextComplementRangeUpperBound == Cut.belowAll()) { + return endOfData(); +@@ -631,8 +631,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return Iterators.size(entryIterator()); + } + +- @Override + @CheckForNull ++ @Override + public Range get(@CheckForNull Object key) { + if (key instanceof Cut) { + try { +@@ -749,8 +749,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return get(key) != null; + } + +- @Override + @CheckForNull ++ @Override + public Range get(@CheckForNull Object key) { + if (key instanceof Cut) { + try { +@@ -805,8 +805,8 @@ public class TreeRangeSet> extends AbstractRangeSet + Ordering.natural() + .min(lowerBoundWindow.upperBound, Cut.belowValue(restriction.upperBound)); + return new AbstractIterator, Range>>() { +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (!completeRangeItr.hasNext()) { + return endOfData(); +@@ -839,8 +839,8 @@ public class TreeRangeSet> extends AbstractRangeSet + .values() + .iterator(); + return new AbstractIterator, Range>>() { +- @Override + @CheckForNull ++ @Override + protected Entry, Range> computeNext() { + if (!completeRangeItr.hasNext()) { + return endOfData(); +@@ -889,8 +889,8 @@ public class TreeRangeSet> extends AbstractRangeSet + return false; + } + +- @Override + @CheckForNull ++ @Override + public Range rangeContaining(C value) { + if (!restriction.contains(value)) { + return null; +diff --git a/guava/src/com/google/common/collect/TreeTraverser.java b/guava/src/com/google/common/collect/TreeTraverser.java +index b5d2a4293f..c7acb9a72f 100644 +--- a/guava/src/com/google/common/collect/TreeTraverser.java ++++ b/guava/src/com/google/common/collect/TreeTraverser.java +@@ -223,8 +223,8 @@ public abstract class TreeTraverser { + stack.addLast(expand(root)); + } + +- @Override + @CheckForNull ++ @Override + protected T computeNext() { + while (!stack.isEmpty()) { + PostOrderNode top = stack.getLast(); +diff --git a/guava/src/com/google/common/collect/UnmodifiableIterator.java b/guava/src/com/google/common/collect/UnmodifiableIterator.java +index 03e52aa203..eda2d8a082 100644 +--- a/guava/src/com/google/common/collect/UnmodifiableIterator.java ++++ b/guava/src/com/google/common/collect/UnmodifiableIterator.java +@@ -44,8 +44,8 @@ public abstract class UnmodifiableIterator implement + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void remove() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/UnmodifiableListIterator.java b/guava/src/com/google/common/collect/UnmodifiableListIterator.java +index f3d3b921b7..a4e2a2b2fc 100644 +--- a/guava/src/com/google/common/collect/UnmodifiableListIterator.java ++++ b/guava/src/com/google/common/collect/UnmodifiableListIterator.java +@@ -41,8 +41,8 @@ public abstract class UnmodifiableListIterator + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void add(@ParametricNullness E e) { + throw new UnsupportedOperationException(); + } +@@ -54,8 +54,8 @@ public abstract class UnmodifiableListIterator + * @deprecated Unsupported operation. + */ + @Deprecated +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public final void set(@ParametricNullness E e) { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/collect/UnmodifiableSortedMultiset.java b/guava/src/com/google/common/collect/UnmodifiableSortedMultiset.java +index 31f3c71977..3553cd2f84 100644 +--- a/guava/src/com/google/common/collect/UnmodifiableSortedMultiset.java ++++ b/guava/src/com/google/common/collect/UnmodifiableSortedMultiset.java +@@ -71,26 +71,26 @@ final class UnmodifiableSortedMultiset extends Unmod + return result; + } + +- @Override + @CheckForNull ++ @Override + public Entry firstEntry() { + return delegate().firstEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry lastEntry() { + return delegate().lastEntry(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollFirstEntry() { + throw new UnsupportedOperationException(); + } + +- @Override + @CheckForNull ++ @Override + public Entry pollLastEntry() { + throw new UnsupportedOperationException(); + } +diff --git a/guava/src/com/google/common/escape/ArrayBasedCharEscaper.java b/guava/src/com/google/common/escape/ArrayBasedCharEscaper.java +index dbe6e35680..cd6c35a6fd 100644 +--- a/guava/src/com/google/common/escape/ArrayBasedCharEscaper.java ++++ b/guava/src/com/google/common/escape/ArrayBasedCharEscaper.java +@@ -120,8 +120,8 @@ public abstract class ArrayBasedCharEscaper extends CharEscaper { + * + * @return the replacement characters, or {@code null} if no escaping was required + */ +- @Override + @CheckForNull ++ @Override + protected final char[] escape(char c) { + if (c < replacementsLength) { + char[] chars = replacements[c]; +diff --git a/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java b/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java +index 355faaa10d..ec0e5f7f42 100644 +--- a/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java ++++ b/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java +@@ -160,8 +160,8 @@ public abstract class ArrayBasedUnicodeEscaper extends UnicodeEscaper { + * + * @return the replacement characters, or {@code null} if no escaping was required + */ +- @Override + @CheckForNull ++ @Override + protected final char[] escape(int cp) { + if (cp < replacementsLength) { + char[] chars = replacements[cp]; +diff --git a/guava/src/com/google/common/escape/CharEscaperBuilder.java b/guava/src/com/google/common/escape/CharEscaperBuilder.java +index 97528cb569..2bdb550521 100644 +--- a/guava/src/com/google/common/escape/CharEscaperBuilder.java ++++ b/guava/src/com/google/common/escape/CharEscaperBuilder.java +@@ -65,8 +65,8 @@ public final class CharEscaperBuilder { + return s; + } + +- @Override + @CheckForNull ++ @Override + protected char[] escape(char c) { + return c < replaceLength ? replacements[c] : null; + } +diff --git a/guava/src/com/google/common/escape/Escapers.java b/guava/src/com/google/common/escape/Escapers.java +index acfb82ce29..7b13e57bbe 100644 +--- a/guava/src/com/google/common/escape/Escapers.java ++++ b/guava/src/com/google/common/escape/Escapers.java +@@ -51,8 +51,8 @@ public final class Escapers { + return checkNotNull(string); + } + +- @Override + @CheckForNull ++ @Override + protected char[] escape(char c) { + // TODO: Fix tests not to call this directly and make it throw an error. + return null; +@@ -155,8 +155,8 @@ public final class Escapers { + private final char[] replacementChars = + unsafeReplacement != null ? unsafeReplacement.toCharArray() : null; + +- @Override + @CheckForNull ++ @Override + protected char[] escapeUnsafe(char c) { + return replacementChars; + } +@@ -227,8 +227,8 @@ public final class Escapers { + /** Private helper to wrap a CharEscaper as a UnicodeEscaper. */ + private static UnicodeEscaper wrap(CharEscaper escaper) { + return new UnicodeEscaper() { +- @Override + @CheckForNull ++ @Override + protected char[] escape(int cp) { + // If a code point maps to a single character, just escape that. + if (cp < Character.MIN_SUPPLEMENTARY_CODE_POINT) { +diff --git a/guava/src/com/google/common/eventbus/SubscriberRegistry.java b/guava/src/com/google/common/eventbus/SubscriberRegistry.java +index 46e982016c..70955c51fa 100644 +--- a/guava/src/com/google/common/eventbus/SubscriberRegistry.java ++++ b/guava/src/com/google/common/eventbus/SubscriberRegistry.java +@@ -222,8 +222,8 @@ final class SubscriberRegistry { + .build( + new CacheLoader, ImmutableSet>>() { + // > is actually needed to compile +- @SuppressWarnings("RedundantTypeArguments") + @Override ++ @SuppressWarnings("RedundantTypeArguments") + public ImmutableSet> load(Class concreteClass) { + return ImmutableSet.>copyOf( + TypeToken.of(concreteClass).getTypes().rawTypes()); +diff --git a/guava/src/com/google/common/graph/AbstractBaseGraph.java b/guava/src/com/google/common/graph/AbstractBaseGraph.java +index 797468b7aa..dda70b8799 100644 +--- a/guava/src/com/google/common/graph/AbstractBaseGraph.java ++++ b/guava/src/com/google/common/graph/AbstractBaseGraph.java +@@ -83,8 +83,8 @@ abstract class AbstractBaseGraph implements BaseGraph { + // Mostly safe: We check contains(u) before calling successors(u), so we perform unsafe + // operations only in weird cases like checking for an EndpointPair in a + // Graph. +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public boolean contains(@CheckForNull Object obj) { + if (!(obj instanceof EndpointPair)) { + return false; +diff --git a/guava/src/com/google/common/graph/AbstractDirectedNetworkConnections.java b/guava/src/com/google/common/graph/AbstractDirectedNetworkConnections.java +index ac452d4d61..668d066dce 100644 +--- a/guava/src/com/google/common/graph/AbstractDirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/AbstractDirectedNetworkConnections.java +@@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkState; + import static com.google.common.graph.Graphs.checkNonNegative; + import static com.google.common.graph.Graphs.checkPositive; ++import static java.util.Collections.unmodifiableSet; + import static java.util.Objects.requireNonNull; + + import com.google.common.collect.Iterables; +@@ -28,7 +29,6 @@ import com.google.common.collect.Sets; + import com.google.common.collect.UnmodifiableIterator; + import com.google.common.math.IntMath; + import java.util.AbstractSet; +-import java.util.Collections; + import java.util.Map; + import java.util.Set; + import javax.annotation.CheckForNull; +@@ -88,12 +88,12 @@ abstract class AbstractDirectedNetworkConnections implements NetworkConnec + + @Override + public Set inEdges() { +- return Collections.unmodifiableSet(inEdgeMap.keySet()); ++ return unmodifiableSet(inEdgeMap.keySet()); + } + + @Override + public Set outEdges() { +- return Collections.unmodifiableSet(outEdgeMap.keySet()); ++ return unmodifiableSet(outEdgeMap.keySet()); + } + + @Override +diff --git a/guava/src/com/google/common/graph/AbstractNetwork.java b/guava/src/com/google/common/graph/AbstractNetwork.java +index d6bf4c36c6..cdfbaff40a 100644 +--- a/guava/src/com/google/common/graph/AbstractNetwork.java ++++ b/guava/src/com/google/common/graph/AbstractNetwork.java +@@ -89,8 +89,8 @@ public abstract class AbstractNetwork implements Network { + // Mostly safe: We check contains(u) before calling successors(u), so we perform unsafe + // operations only in weird cases like checking for an EndpointPair in a + // Network. +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public boolean contains(@CheckForNull Object obj) { + if (!(obj instanceof EndpointPair)) { + return false; +@@ -206,8 +206,8 @@ public abstract class AbstractNetwork implements Network { + return edgeConnecting(endpoints.nodeU(), endpoints.nodeV()); + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(N nodeU, N nodeV) { + Set edgesConnecting = edgesConnecting(nodeU, nodeV); + switch (edgesConnecting.size()) { +@@ -220,8 +220,8 @@ public abstract class AbstractNetwork implements Network { + } + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(EndpointPair endpoints) { + validateEndpoints(endpoints); + return edgeConnectingOrNull(endpoints.nodeU(), endpoints.nodeV()); +diff --git a/guava/src/com/google/common/graph/AbstractUndirectedNetworkConnections.java b/guava/src/com/google/common/graph/AbstractUndirectedNetworkConnections.java +index 8f736d7baa..4506c1bcf2 100644 +--- a/guava/src/com/google/common/graph/AbstractUndirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/AbstractUndirectedNetworkConnections.java +@@ -18,9 +18,9 @@ package com.google.common.graph; + + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkState; ++import static java.util.Collections.unmodifiableSet; + import static java.util.Objects.requireNonNull; + +-import java.util.Collections; + import java.util.Map; + import java.util.Set; + import javax.annotation.CheckForNull; +@@ -53,7 +53,7 @@ abstract class AbstractUndirectedNetworkConnections implements NetworkConn + + @Override + public Set incidentEdges() { +- return Collections.unmodifiableSet(incidentEdgeMap.keySet()); ++ return unmodifiableSet(incidentEdgeMap.keySet()); + } + + @Override +@@ -72,8 +72,8 @@ abstract class AbstractUndirectedNetworkConnections implements NetworkConn + return requireNonNull(incidentEdgeMap.get(edge)); + } + +- @Override + @CheckForNull ++ @Override + public N removeInEdge(E edge, boolean isSelfLoop) { + if (!isSelfLoop) { + return removeOutEdge(edge); +diff --git a/guava/src/com/google/common/graph/DirectedGraphConnections.java b/guava/src/com/google/common/graph/DirectedGraphConnections.java +index 0feb973f3f..d1ca66a52b 100644 +--- a/guava/src/com/google/common/graph/DirectedGraphConnections.java ++++ b/guava/src/com/google/common/graph/DirectedGraphConnections.java +@@ -23,6 +23,7 @@ import static com.google.common.graph.GraphConstants.INNER_CAPACITY; + import static com.google.common.graph.GraphConstants.INNER_LOAD_FACTOR; + import static com.google.common.graph.Graphs.checkNonNegative; + import static com.google.common.graph.Graphs.checkPositive; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.base.Function; + import com.google.common.collect.AbstractIterator; +@@ -31,7 +32,6 @@ import com.google.common.collect.Iterators; + import com.google.common.collect.UnmodifiableIterator; + import java.util.AbstractSet; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; + import java.util.Iterator; +@@ -234,7 +234,7 @@ final class DirectedGraphConnections implements GraphConnections { + @Override + public Set adjacentNodes() { + if (orderedNodeConnections == null) { +- return Collections.unmodifiableSet(adjacentNodeValues.keySet()); ++ return unmodifiableSet(adjacentNodeValues.keySet()); + } else { + return new AbstractSet() { + @Override +@@ -242,8 +242,8 @@ final class DirectedGraphConnections implements GraphConnections { + Iterator> nodeConnections = orderedNodeConnections.iterator(); + Set seenNodes = new HashSet<>(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + while (nodeConnections.hasNext()) { + NodeConnection nodeConnection = nodeConnections.next(); +@@ -278,8 +278,8 @@ final class DirectedGraphConnections implements GraphConnections { + if (orderedNodeConnections == null) { + Iterator> entries = adjacentNodeValues.entrySet().iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + while (entries.hasNext()) { + Entry entry = entries.next(); +@@ -293,8 +293,8 @@ final class DirectedGraphConnections implements GraphConnections { + } else { + Iterator> nodeConnections = orderedNodeConnections.iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + while (nodeConnections.hasNext()) { + NodeConnection nodeConnection = nodeConnections.next(); +@@ -328,8 +328,8 @@ final class DirectedGraphConnections implements GraphConnections { + if (orderedNodeConnections == null) { + Iterator> entries = adjacentNodeValues.entrySet().iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + while (entries.hasNext()) { + Entry entry = entries.next(); +@@ -343,8 +343,8 @@ final class DirectedGraphConnections implements GraphConnections { + } else { + Iterator> nodeConnections = orderedNodeConnections.iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + while (nodeConnections.hasNext()) { + NodeConnection nodeConnection = nodeConnections.next(); +@@ -399,8 +399,8 @@ final class DirectedGraphConnections implements GraphConnections { + + AtomicBoolean alreadySeenSelfLoop = new AtomicBoolean(false); + return new AbstractIterator>() { +- @Override + @CheckForNull ++ @Override + protected EndpointPair computeNext() { + while (resultWithDoubleSelfLoop.hasNext()) { + EndpointPair edge = resultWithDoubleSelfLoop.next(); +@@ -417,9 +417,9 @@ final class DirectedGraphConnections implements GraphConnections { + }; + } + +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public V value(N node) { + checkNotNull(node); + Object value = adjacentNodeValues.get(node); +@@ -432,8 +432,8 @@ final class DirectedGraphConnections implements GraphConnections { + return (V) value; + } + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public void removePredecessor(N node) { + checkNotNull(node); + +@@ -459,9 +459,9 @@ final class DirectedGraphConnections implements GraphConnections { + } + } + +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public V removeSuccessor(Object node) { + checkNotNull(node); + Object previousValue = adjacentNodeValues.get(node); +@@ -523,9 +523,9 @@ final class DirectedGraphConnections implements GraphConnections { + } + } + +- @SuppressWarnings("unchecked") +- @Override + @CheckForNull ++ @Override ++ @SuppressWarnings("unchecked") + public V addSuccessor(N node, V value) { + Object previousValue = adjacentNodeValues.put(node, value); + Object previousSuccessor; +diff --git a/guava/src/com/google/common/graph/DirectedMultiNetworkConnections.java b/guava/src/com/google/common/graph/DirectedMultiNetworkConnections.java +index bd0e546f26..341c91248d 100644 +--- a/guava/src/com/google/common/graph/DirectedMultiNetworkConnections.java ++++ b/guava/src/com/google/common/graph/DirectedMultiNetworkConnections.java +@@ -19,14 +19,13 @@ package com.google.common.graph; + import static com.google.common.base.Preconditions.checkState; + import static com.google.common.graph.GraphConstants.INNER_CAPACITY; + import static com.google.common.graph.GraphConstants.INNER_LOAD_FACTOR; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.collect.HashMultiset; +-import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multiset; + import com.google.errorprone.annotations.concurrent.LazyInit; + import java.lang.ref.Reference; + import java.lang.ref.SoftReference; +-import java.util.Collections; + import java.util.HashMap; + import java.util.Map; + import java.util.Set; +@@ -56,15 +55,14 @@ final class DirectedMultiNetworkConnections extends AbstractDirectedNetwor + + static DirectedMultiNetworkConnections ofImmutable( + Map inEdges, Map outEdges, int selfLoopCount) { +- return new DirectedMultiNetworkConnections<>( +- ImmutableMap.copyOf(inEdges), ImmutableMap.copyOf(outEdges), selfLoopCount); ++ return new DirectedMultiNetworkConnections<>(inEdges, outEdges, selfLoopCount); + } + + @CheckForNull @LazyInit private transient Reference> predecessorsReference; + + @Override + public Set predecessors() { +- return Collections.unmodifiableSet(predecessorsMultiset().elementSet()); ++ return unmodifiableSet(predecessorsMultiset().elementSet()); + } + + private Multiset predecessorsMultiset() { +@@ -80,7 +78,7 @@ final class DirectedMultiNetworkConnections extends AbstractDirectedNetwor + + @Override + public Set successors() { +- return Collections.unmodifiableSet(successorsMultiset().elementSet()); ++ return unmodifiableSet(successorsMultiset().elementSet()); + } + + private Multiset successorsMultiset() { +diff --git a/guava/src/com/google/common/graph/DirectedNetworkConnections.java b/guava/src/com/google/common/graph/DirectedNetworkConnections.java +index 9d70c790ee..65f1a80e3b 100644 +--- a/guava/src/com/google/common/graph/DirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/DirectedNetworkConnections.java +@@ -17,11 +17,11 @@ + package com.google.common.graph; + + import static com.google.common.graph.GraphConstants.EXPECTED_DEGREE; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.collect.BiMap; + import com.google.common.collect.HashBiMap; + import com.google.common.collect.ImmutableBiMap; +-import java.util.Collections; + import java.util.Map; + import java.util.Set; + +@@ -53,12 +53,12 @@ final class DirectedNetworkConnections extends AbstractDirectedNetworkConn + + @Override + public Set predecessors() { +- return Collections.unmodifiableSet(((BiMap) inEdgeMap).values()); ++ return unmodifiableSet(((BiMap) inEdgeMap).values()); + } + + @Override + public Set successors() { +- return Collections.unmodifiableSet(((BiMap) outEdgeMap).values()); ++ return unmodifiableSet(((BiMap) outEdgeMap).values()); + } + + @Override +diff --git a/guava/src/com/google/common/graph/EndpointPair.java b/guava/src/com/google/common/graph/EndpointPair.java +index fe2397c6b9..bccfda16ea 100644 +--- a/guava/src/com/google/common/graph/EndpointPair.java ++++ b/guava/src/com/google/common/graph/EndpointPair.java +@@ -38,7 +38,7 @@ import javax.annotation.CheckForNull; + * @since 20.0 + */ + @Beta +-@Immutable(containerOf = {"N"}) ++@Immutable(containerOf = "N") + @ElementTypesAreNonnullByDefault + public abstract class EndpointPair implements Iterable { + private final N nodeU; +diff --git a/guava/src/com/google/common/graph/EndpointPairIterator.java b/guava/src/com/google/common/graph/EndpointPairIterator.java +index 7096dbe3da..b501236378 100644 +--- a/guava/src/com/google/common/graph/EndpointPairIterator.java ++++ b/guava/src/com/google/common/graph/EndpointPairIterator.java +@@ -74,8 +74,8 @@ abstract class EndpointPairIterator extends AbstractIterator> + super(graph); + } + +- @Override + @CheckForNull ++ @Override + protected EndpointPair computeNext() { + while (true) { + if (successorIterator.hasNext()) { +@@ -124,8 +124,8 @@ abstract class EndpointPairIterator extends AbstractIterator> + this.visitedNodes = Sets.newHashSetWithExpectedSize(graph.nodes().size() + 1); + } + +- @Override + @CheckForNull ++ @Override + protected EndpointPair computeNext() { + while (true) { + /* +diff --git a/guava/src/com/google/common/graph/ForwardingNetwork.java b/guava/src/com/google/common/graph/ForwardingNetwork.java +index 9f1c6e7702..dc0e010253 100644 +--- a/guava/src/com/google/common/graph/ForwardingNetwork.java ++++ b/guava/src/com/google/common/graph/ForwardingNetwork.java +@@ -142,14 +142,14 @@ abstract class ForwardingNetwork extends AbstractNetwork { + return delegate().edgeConnecting(endpoints); + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(N nodeU, N nodeV) { + return delegate().edgeConnectingOrNull(nodeU, nodeV); + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(EndpointPair endpoints) { + return delegate().edgeConnectingOrNull(endpoints); + } +diff --git a/guava/src/com/google/common/graph/ForwardingValueGraph.java b/guava/src/com/google/common/graph/ForwardingValueGraph.java +index fcd5d28bc3..871ecfb1b5 100644 +--- a/guava/src/com/google/common/graph/ForwardingValueGraph.java ++++ b/guava/src/com/google/common/graph/ForwardingValueGraph.java +@@ -116,14 +116,14 @@ abstract class ForwardingValueGraph extends AbstractValueGraph { + return delegate().edgeValue(endpoints); + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(N nodeU, N nodeV, @CheckForNull V defaultValue) { + return delegate().edgeValueOrDefault(nodeU, nodeV, defaultValue); + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(EndpointPair endpoints, @CheckForNull V defaultValue) { + return delegate().edgeValueOrDefault(endpoints, defaultValue); + } +diff --git a/guava/src/com/google/common/graph/Graphs.java b/guava/src/com/google/common/graph/Graphs.java +index 6ab9f56615..7576fe0374 100644 +--- a/guava/src/com/google/common/graph/Graphs.java ++++ b/guava/src/com/google/common/graph/Graphs.java +@@ -374,14 +374,14 @@ public final class Graphs { + return delegate().edgeValue(transpose(endpoints)); + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(N nodeU, N nodeV, @CheckForNull V defaultValue) { + return delegate().edgeValueOrDefault(nodeV, nodeU, defaultValue); // transpose + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(EndpointPair endpoints, @CheckForNull V defaultValue) { + return delegate().edgeValueOrDefault(transpose(endpoints), defaultValue); + } +@@ -455,14 +455,14 @@ public final class Graphs { + return delegate().edgeConnecting(transpose(endpoints)); + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(N nodeU, N nodeV) { + return delegate().edgeConnectingOrNull(nodeV, nodeU); // transpose + } + +- @Override + @CheckForNull ++ @Override + public E edgeConnectingOrNull(EndpointPair endpoints) { + return delegate().edgeConnectingOrNull(transpose(endpoints)); + } +diff --git a/guava/src/com/google/common/graph/ImmutableGraph.java b/guava/src/com/google/common/graph/ImmutableGraph.java +index f829e96999..0fc2536be9 100644 +--- a/guava/src/com/google/common/graph/ImmutableGraph.java ++++ b/guava/src/com/google/common/graph/ImmutableGraph.java +@@ -44,7 +44,7 @@ import com.google.errorprone.annotations.Immutable; + * @since 20.0 + */ + @Beta +-@Immutable(containerOf = {"N"}) ++@Immutable(containerOf = "N") + @ElementTypesAreNonnullByDefault + public class ImmutableGraph extends ForwardingGraph { + @SuppressWarnings("Immutable") // The backing graph must be immutable. +diff --git a/guava/src/com/google/common/graph/ImmutableNetwork.java b/guava/src/com/google/common/graph/ImmutableNetwork.java +index c29f8a3928..9519593680 100644 +--- a/guava/src/com/google/common/graph/ImmutableNetwork.java ++++ b/guava/src/com/google/common/graph/ImmutableNetwork.java +@@ -44,7 +44,7 @@ import java.util.Map; + * @since 20.0 + */ + @Beta +-@Immutable(containerOf = {"N", "E"}) ++@Immutable(containerOf = {"E", "N"}) + @SuppressWarnings("Immutable") // Extends StandardNetwork but uses ImmutableMaps. + @ElementTypesAreNonnullByDefault + public final class ImmutableNetwork extends StandardNetwork { +diff --git a/guava/src/com/google/common/graph/MapRetrievalCache.java b/guava/src/com/google/common/graph/MapRetrievalCache.java +index ada78f2841..02c24e8d33 100644 +--- a/guava/src/com/google/common/graph/MapRetrievalCache.java ++++ b/guava/src/com/google/common/graph/MapRetrievalCache.java +@@ -37,9 +37,9 @@ final class MapRetrievalCache extends MapIteratorCache { + super(backingMap); + } + +- @SuppressWarnings("unchecked") // Safe because we only cast if key is found in map. ++ @CheckForNull // Safe because we only cast if key is found in map. + @Override +- @CheckForNull ++ @SuppressWarnings("unchecked") + V get(Object key) { + checkNotNull(key); + V value = getIfCached(key); +@@ -56,8 +56,8 @@ final class MapRetrievalCache extends MapIteratorCache { + + // Internal methods (package-visible, but treat as only subclass-visible) + +- @Override + @CheckForNull ++ @Override + V getIfCached(@CheckForNull Object key) { + V value = super.getIfCached(key); + if (value != null) { +diff --git a/guava/src/com/google/common/graph/MultiEdgesConnecting.java b/guava/src/com/google/common/graph/MultiEdgesConnecting.java +index 620f986a55..a0a3fcfca2 100644 +--- a/guava/src/com/google/common/graph/MultiEdgesConnecting.java ++++ b/guava/src/com/google/common/graph/MultiEdgesConnecting.java +@@ -50,8 +50,8 @@ abstract class MultiEdgesConnecting extends AbstractSet { + public UnmodifiableIterator iterator() { + Iterator> entries = outEdgeToNode.entrySet().iterator(); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected E computeNext() { + while (entries.hasNext()) { + Entry entry = entries.next(); +diff --git a/guava/src/com/google/common/graph/StandardMutableNetwork.java b/guava/src/com/google/common/graph/StandardMutableNetwork.java +index c58b6d3909..d8c464682f 100644 +--- a/guava/src/com/google/common/graph/StandardMutableNetwork.java ++++ b/guava/src/com/google/common/graph/StandardMutableNetwork.java +@@ -49,8 +49,8 @@ final class StandardMutableNetwork extends StandardNetwork + super(builder); + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean addNode(N node) { + checkNotNull(node, "node"); + +@@ -74,8 +74,8 @@ final class StandardMutableNetwork extends StandardNetwork + return connections; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean addEdge(N nodeU, N nodeV, E edge) { + checkNotNull(nodeU, "nodeU"); + checkNotNull(nodeV, "nodeV"); +@@ -118,15 +118,15 @@ final class StandardMutableNetwork extends StandardNetwork + return true; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean addEdge(EndpointPair endpoints, E edge) { + validateEndpoints(endpoints); + return addEdge(endpoints.nodeU(), endpoints.nodeV(), edge); + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean removeNode(N node) { + checkNotNull(node, "node"); + +@@ -144,8 +144,8 @@ final class StandardMutableNetwork extends StandardNetwork + return true; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean removeEdge(E edge) { + checkNotNull(edge, "edge"); + +diff --git a/guava/src/com/google/common/graph/StandardMutableValueGraph.java b/guava/src/com/google/common/graph/StandardMutableValueGraph.java +index 0ea641a5b1..bf00e2108a 100644 +--- a/guava/src/com/google/common/graph/StandardMutableValueGraph.java ++++ b/guava/src/com/google/common/graph/StandardMutableValueGraph.java +@@ -57,8 +57,8 @@ final class StandardMutableValueGraph extends StandardValueGraph + return incidentEdgeOrder; + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean addNode(N node) { + checkNotNull(node, "node"); + +@@ -82,9 +82,9 @@ final class StandardMutableValueGraph extends StandardValueGraph + return connections; + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public V putEdgeValue(N nodeU, N nodeV, V value) { + checkNotNull(nodeU, "nodeU"); + checkNotNull(nodeV, "nodeV"); +@@ -110,16 +110,16 @@ final class StandardMutableValueGraph extends StandardValueGraph + return previousValue; + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public V putEdgeValue(EndpointPair endpoints, V value) { + validateEndpoints(endpoints); + return putEdgeValue(endpoints.nodeU(), endpoints.nodeV(), value); + } + +- @Override + @CanIgnoreReturnValue ++ @Override + public boolean removeNode(N node) { + checkNotNull(node, "node"); + +@@ -155,9 +155,9 @@ final class StandardMutableValueGraph extends StandardValueGraph + return true; + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public V removeEdge(N nodeU, N nodeV) { + checkNotNull(nodeU, "nodeU"); + checkNotNull(nodeV, "nodeV"); +@@ -176,9 +176,9 @@ final class StandardMutableValueGraph extends StandardValueGraph + return previousValue; + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public V removeEdge(EndpointPair endpoints) { + validateEndpoints(endpoints); + return removeEdge(endpoints.nodeU(), endpoints.nodeV()); +diff --git a/guava/src/com/google/common/graph/StandardValueGraph.java b/guava/src/com/google/common/graph/StandardValueGraph.java +index ab3ae582b5..5e1f894060 100644 +--- a/guava/src/com/google/common/graph/StandardValueGraph.java ++++ b/guava/src/com/google/common/graph/StandardValueGraph.java +@@ -140,14 +140,14 @@ class StandardValueGraph extends AbstractValueGraph { + && hasEdgeConnectingInternal(endpoints.nodeU(), endpoints.nodeV()); + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(N nodeU, N nodeV, @CheckForNull V defaultValue) { + return edgeValueOrDefaultInternal(checkNotNull(nodeU), checkNotNull(nodeV), defaultValue); + } + +- @Override + @CheckForNull ++ @Override + public V edgeValueOrDefault(EndpointPair endpoints, @CheckForNull V defaultValue) { + validateEndpoints(endpoints); + return edgeValueOrDefaultInternal(endpoints.nodeU(), endpoints.nodeV(), defaultValue); +diff --git a/guava/src/com/google/common/graph/Traverser.java b/guava/src/com/google/common/graph/Traverser.java +index fb594b4403..ce3037cbb8 100644 +--- a/guava/src/com/google/common/graph/Traverser.java ++++ b/guava/src/com/google/common/graph/Traverser.java +@@ -384,8 +384,8 @@ public abstract class Traverser { + static Traversal inGraph(SuccessorsFunction graph) { + Set visited = new HashSet<>(); + return new Traversal(graph) { +- @Override + @CheckForNull ++ @Override + N visitNext(Deque> horizon) { + Iterator top = horizon.getFirst(); + while (top.hasNext()) { +@@ -442,8 +442,8 @@ public abstract class Traverser { + Deque> horizon = new ArrayDeque<>(); + horizon.add(startNodes); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + do { + N next = visitNext(horizon); +@@ -467,8 +467,8 @@ public abstract class Traverser { + Deque> horizon = new ArrayDeque<>(); + horizon.add(startNodes); + return new AbstractIterator() { +- @Override + @CheckForNull ++ @Override + protected N computeNext() { + for (N next = visitNext(horizon); next != null; next = visitNext(horizon)) { + Iterator successors = successorFunction.successors(next).iterator(); +diff --git a/guava/src/com/google/common/graph/UndirectedGraphConnections.java b/guava/src/com/google/common/graph/UndirectedGraphConnections.java +index 4eeb2328fe..7a07f72ed9 100644 +--- a/guava/src/com/google/common/graph/UndirectedGraphConnections.java ++++ b/guava/src/com/google/common/graph/UndirectedGraphConnections.java +@@ -19,10 +19,9 @@ package com.google.common.graph; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.graph.GraphConstants.INNER_CAPACITY; + import static com.google.common.graph.GraphConstants.INNER_LOAD_FACTOR; ++import static java.util.Collections.unmodifiableSet; + +-import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Iterators; +-import java.util.Collections; + import java.util.HashMap; + import java.util.Iterator; + import java.util.LinkedHashMap; +@@ -59,12 +58,12 @@ final class UndirectedGraphConnections implements GraphConnections { + } + + static UndirectedGraphConnections ofImmutable(Map adjacentNodeValues) { +- return new UndirectedGraphConnections<>(ImmutableMap.copyOf(adjacentNodeValues)); ++ return new UndirectedGraphConnections<>(adjacentNodeValues); + } + + @Override + public Set adjacentNodes() { +- return Collections.unmodifiableSet(adjacentNodeValues.keySet()); ++ return unmodifiableSet(adjacentNodeValues.keySet()); + } + + @Override +@@ -84,8 +83,8 @@ final class UndirectedGraphConnections implements GraphConnections { + (N incidentNode) -> EndpointPair.unordered(thisNode, incidentNode)); + } + +- @Override + @CheckForNull ++ @Override + public V value(N node) { + return adjacentNodeValues.get(node); + } +@@ -96,8 +95,8 @@ final class UndirectedGraphConnections implements GraphConnections { + V unused = removeSuccessor(node); + } + +- @Override + @CheckForNull ++ @Override + public V removeSuccessor(N node) { + return adjacentNodeValues.remove(node); + } +@@ -108,8 +107,8 @@ final class UndirectedGraphConnections implements GraphConnections { + V unused = addSuccessor(node, value); + } + +- @Override + @CheckForNull ++ @Override + public V addSuccessor(N node, V value) { + return adjacentNodeValues.put(node, value); + } +diff --git a/guava/src/com/google/common/graph/UndirectedMultiNetworkConnections.java b/guava/src/com/google/common/graph/UndirectedMultiNetworkConnections.java +index 6caac3b715..29e0d29544 100644 +--- a/guava/src/com/google/common/graph/UndirectedMultiNetworkConnections.java ++++ b/guava/src/com/google/common/graph/UndirectedMultiNetworkConnections.java +@@ -19,14 +19,13 @@ package com.google.common.graph; + import static com.google.common.base.Preconditions.checkState; + import static com.google.common.graph.GraphConstants.INNER_CAPACITY; + import static com.google.common.graph.GraphConstants.INNER_LOAD_FACTOR; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.collect.HashMultiset; +-import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Multiset; + import com.google.errorprone.annotations.concurrent.LazyInit; + import java.lang.ref.Reference; + import java.lang.ref.SoftReference; +-import java.util.Collections; + import java.util.HashMap; + import java.util.Map; + import java.util.Set; +@@ -53,14 +52,14 @@ final class UndirectedMultiNetworkConnections + } + + static UndirectedMultiNetworkConnections ofImmutable(Map incidentEdges) { +- return new UndirectedMultiNetworkConnections<>(ImmutableMap.copyOf(incidentEdges)); ++ return new UndirectedMultiNetworkConnections<>(incidentEdges); + } + + @CheckForNull @LazyInit private transient Reference> adjacentNodesReference; + + @Override + public Set adjacentNodes() { +- return Collections.unmodifiableSet(adjacentNodesMultiset().elementSet()); ++ return unmodifiableSet(adjacentNodesMultiset().elementSet()); + } + + private Multiset adjacentNodesMultiset() { +@@ -82,8 +81,8 @@ final class UndirectedMultiNetworkConnections + }; + } + +- @Override + @CheckForNull ++ @Override + public N removeInEdge(E edge, boolean isSelfLoop) { + if (!isSelfLoop) { + return removeOutEdge(edge); +diff --git a/guava/src/com/google/common/graph/UndirectedNetworkConnections.java b/guava/src/com/google/common/graph/UndirectedNetworkConnections.java +index f11f98867c..f8aa0ec66c 100644 +--- a/guava/src/com/google/common/graph/UndirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/UndirectedNetworkConnections.java +@@ -17,11 +17,11 @@ + package com.google.common.graph; + + import static com.google.common.graph.GraphConstants.EXPECTED_DEGREE; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.collect.BiMap; + import com.google.common.collect.HashBiMap; + import com.google.common.collect.ImmutableBiMap; +-import java.util.Collections; + import java.util.Map; + import java.util.Set; + +@@ -50,7 +50,7 @@ final class UndirectedNetworkConnections extends AbstractUndirectedNetwork + + @Override + public Set adjacentNodes() { +- return Collections.unmodifiableSet(((BiMap) incidentEdgeMap).values()); ++ return unmodifiableSet(((BiMap) incidentEdgeMap).values()); + } + + @Override +diff --git a/guava/src/com/google/common/hash/AbstractHasher.java b/guava/src/com/google/common/hash/AbstractHasher.java +index c72e05be05..9afd67b475 100644 +--- a/guava/src/com/google/common/hash/AbstractHasher.java ++++ b/guava/src/com/google/common/hash/AbstractHasher.java +@@ -14,7 +14,8 @@ + + package com.google.common.hash; + +-import com.google.common.base.Preconditions; ++import static com.google.common.base.Preconditions.checkPositionIndexes; ++ + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.nio.ByteBuffer; + import java.nio.charset.Charset; +@@ -64,7 +65,7 @@ abstract class AbstractHasher implements Hasher { + + @Override + public Hasher putBytes(byte[] bytes, int off, int len) { +- Preconditions.checkPositionIndexes(off, off + len, bytes.length); ++ checkPositionIndexes(off, off + len, bytes.length); + for (int i = 0; i < len; i++) { + putByte(bytes[off + i]); + } +diff --git a/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java b/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java +index 4969e35b22..8b579410df 100644 +--- a/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java ++++ b/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java +@@ -14,7 +14,8 @@ + + package com.google.common.hash; + +-import com.google.common.base.Preconditions; ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.google.errorprone.annotations.Immutable; + import java.io.ByteArrayOutputStream; + import java.nio.ByteBuffer; +@@ -39,7 +40,7 @@ abstract class AbstractNonStreamingHashFunction extends AbstractHashFunction { + + @Override + public Hasher newHasher(int expectedInputSize) { +- Preconditions.checkArgument(expectedInputSize >= 0); ++ checkArgument(expectedInputSize >= 0); + return new BufferingHasher(expectedInputSize); + } + +diff --git a/guava/src/com/google/common/hash/Fingerprint2011.java b/guava/src/com/google/common/hash/Fingerprint2011.java +index 1b01e00924..ff5ee5088e 100644 +--- a/guava/src/com/google/common/hash/Fingerprint2011.java ++++ b/guava/src/com/google/common/hash/Fingerprint2011.java +@@ -192,7 +192,6 @@ final class Fingerprint2011 extends AbstractNonStreamingHashFunction { + } + + hash = shiftMix(hash) * mul; +- hash = shiftMix(hash); +- return hash; ++ return shiftMix(hash); + } + } +diff --git a/guava/src/com/google/common/hash/Funnels.java b/guava/src/com/google/common/hash/Funnels.java +index b8e63d504d..f6f2b34b6a 100644 +--- a/guava/src/com/google/common/hash/Funnels.java ++++ b/guava/src/com/google/common/hash/Funnels.java +@@ -14,8 +14,9 @@ + + package com.google.common.hash; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.Beta; +-import com.google.common.base.Preconditions; + import java.io.OutputStream; + import java.io.Serializable; + import java.nio.charset.Charset; +@@ -91,7 +92,7 @@ public final class Funnels { + private final Charset charset; + + StringCharsetFunnel(Charset charset) { +- this.charset = Preconditions.checkNotNull(charset); ++ this.charset = checkNotNull(charset); + } + + @Override +@@ -176,7 +177,7 @@ public final class Funnels { + private final Funnel elementFunnel; + + SequentialFunnel(Funnel elementFunnel) { +- this.elementFunnel = Preconditions.checkNotNull(elementFunnel); ++ this.elementFunnel = checkNotNull(elementFunnel); + } + + @Override +@@ -247,7 +248,7 @@ public final class Funnels { + final PrimitiveSink sink; + + SinkAsStream(PrimitiveSink sink) { +- this.sink = Preconditions.checkNotNull(sink); ++ this.sink = checkNotNull(sink); + } + + @Override +diff --git a/guava/src/com/google/common/hash/HashCode.java b/guava/src/com/google/common/hash/HashCode.java +index fde2a86d64..fc1e9ee0dd 100644 +--- a/guava/src/com/google/common/hash/HashCode.java ++++ b/guava/src/com/google/common/hash/HashCode.java +@@ -16,9 +16,9 @@ package com.google.common.hash; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndexes; + import static com.google.common.base.Preconditions.checkState; + +-import com.google.common.base.Preconditions; + import com.google.common.primitives.Ints; + import com.google.common.primitives.UnsignedInts; + import com.google.errorprone.annotations.CanIgnoreReturnValue; +@@ -84,7 +84,7 @@ public abstract class HashCode { + @CanIgnoreReturnValue + public int writeBytesTo(byte[] dest, int offset, int maxLength) { + maxLength = Ints.min(maxLength, bits() / 8); +- Preconditions.checkPositionIndexes(offset, offset + maxLength, dest.length); ++ checkPositionIndexes(offset, offset + maxLength, dest.length); + writeBytesToImpl(dest, offset, maxLength); + return maxLength; + } +diff --git a/guava/src/com/google/common/hash/Hasher.java b/guava/src/com/google/common/hash/Hasher.java +index b3f24fa282..1799298436 100644 +--- a/guava/src/com/google/common/hash/Hasher.java ++++ b/guava/src/com/google/common/hash/Hasher.java +@@ -136,7 +136,7 @@ public interface Hasher extends PrimitiveSink { + * @deprecated This returns {@link Object#hashCode()}; you almost certainly mean to call {@code + * hash().asInt()}. + */ +- @Override + @Deprecated ++ @Override + int hashCode(); + } +diff --git a/guava/src/com/google/common/hash/HashingInputStream.java b/guava/src/com/google/common/hash/HashingInputStream.java +index bf9464ce55..8db29550c6 100644 +--- a/guava/src/com/google/common/hash/HashingInputStream.java ++++ b/guava/src/com/google/common/hash/HashingInputStream.java +@@ -48,8 +48,8 @@ public final class HashingInputStream extends FilterInputStream { + * Reads the next byte of data from the underlying input stream and updates the hasher with the + * byte read. + */ +- @Override + @CanIgnoreReturnValue ++ @Override + public int read() throws IOException { + int b = in.read(); + if (b != -1) { +@@ -62,8 +62,8 @@ public final class HashingInputStream extends FilterInputStream { + * Reads the specified bytes of data from the underlying input stream and updates the hasher with + * the bytes read. + */ +- @Override + @CanIgnoreReturnValue ++ @Override + public int read(byte[] bytes, int off, int len) throws IOException { + int numOfBytesRead = in.read(bytes, off, len); + if (numOfBytesRead != -1) { +diff --git a/guava/src/com/google/common/hash/Murmur3_32HashFunction.java b/guava/src/com/google/common/hash/Murmur3_32HashFunction.java +index a47184be58..62ed61b1aa 100644 +--- a/guava/src/com/google/common/hash/Murmur3_32HashFunction.java ++++ b/guava/src/com/google/common/hash/Murmur3_32HashFunction.java +@@ -148,8 +148,8 @@ final class Murmur3_32HashFunction extends AbstractHashFunction implements Seria + return fmix(h1, Chars.BYTES * input.length()); + } + +- @SuppressWarnings("deprecation") // need to use Charsets for Android tests to pass +- @Override ++ @Override // need to use Charsets for Android tests to pass ++ @SuppressWarnings("deprecation") + public HashCode hashString(CharSequence input, Charset charset) { + if (Charsets.UTF_8.equals(charset)) { + int utf16Length = input.length(); +@@ -252,8 +252,7 @@ final class Murmur3_32HashFunction extends AbstractHashFunction implements Seria + private static int mixH1(int h1, int k1) { + h1 ^= k1; + h1 = Integer.rotateLeft(h1, 13); +- h1 = h1 * 5 + 0xe6546b64; +- return h1; ++ return h1 * 5 + 0xe6546b64; + } + + // Finalization mix - force all bits of a hash block to avalanche +@@ -346,8 +345,8 @@ final class Murmur3_32HashFunction extends AbstractHashFunction implements Seria + return this; + } + +- @SuppressWarnings("deprecation") // need to use Charsets for Android tests to pass +- @Override ++ @Override // need to use Charsets for Android tests to pass ++ @SuppressWarnings("deprecation") + public Hasher putString(CharSequence input, Charset charset) { + if (Charsets.UTF_8.equals(charset)) { + int utf16Length = input.length(); +diff --git a/guava/src/com/google/common/io/BaseEncoding.java b/guava/src/com/google/common/io/BaseEncoding.java +index 9eb3a859d9..ac647b2724 100644 +--- a/guava/src/com/google/common/io/BaseEncoding.java ++++ b/guava/src/com/google/common/io/BaseEncoding.java +@@ -725,8 +725,8 @@ public abstract class BaseEncoding { + return bytesWritten; + } + +- @Override +- @GwtIncompatible // Reader,InputStream ++ @GwtIncompatible ++ @Override // Reader,InputStream + public InputStream decodingStream(Reader reader) { + checkNotNull(reader); + return new InputStream() { +@@ -859,7 +859,7 @@ public abstract class BaseEncoding { + @Override + public String toString() { + StringBuilder builder = new StringBuilder("BaseEncoding."); +- builder.append(alphabet.toString()); ++ builder.append(alphabet); + if (8 % alphabet.bitsPerChar != 0) { + if (paddingChar == null) { + builder.append(".omitPadding()"); +@@ -1138,8 +1138,8 @@ public abstract class BaseEncoding { + return delegate.decodeTo(target, stripped); + } + +- @Override +- @GwtIncompatible // Reader,InputStream ++ @GwtIncompatible ++ @Override // Reader,InputStream + public InputStream decodingStream(Reader reader) { + return delegate.decodingStream(ignoringReader(reader, separator)); + } +diff --git a/guava/src/com/google/common/io/ByteArrayDataInput.java b/guava/src/com/google/common/io/ByteArrayDataInput.java +index cf84fcc136..c96d2563f7 100644 +--- a/guava/src/com/google/common/io/ByteArrayDataInput.java ++++ b/guava/src/com/google/common/io/ByteArrayDataInput.java +@@ -87,8 +87,8 @@ public interface ByteArrayDataInput extends DataInput { + double readDouble(); + + @CanIgnoreReturnValue // to skip a line +- @Override + @CheckForNull ++ @Override + String readLine(); + + @CanIgnoreReturnValue // to skip a field +diff --git a/guava/src/com/google/common/io/ByteSink.java b/guava/src/com/google/common/io/ByteSink.java +index 7a6af6fc58..5de083075e 100644 +--- a/guava/src/com/google/common/io/ByteSink.java ++++ b/guava/src/com/google/common/io/ByteSink.java +@@ -152,7 +152,7 @@ public abstract class ByteSink { + + @Override + public String toString() { +- return ByteSink.this.toString() + ".asCharSink(" + charset + ")"; ++ return ByteSink.this + ".asCharSink(" + charset + ")"; + } + } + } +diff --git a/guava/src/com/google/common/io/ByteSource.java b/guava/src/com/google/common/io/ByteSource.java +index c8da9678b8..afd9531bae 100644 +--- a/guava/src/com/google/common/io/ByteSource.java ++++ b/guava/src/com/google/common/io/ByteSource.java +@@ -488,7 +488,7 @@ public abstract class ByteSource { + + @Override + public String toString() { +- return ByteSource.this.toString() + ".asCharSource(" + charset + ")"; ++ return ByteSource.this + ".asCharSource(" + charset + ")"; + } + } + +@@ -567,7 +567,7 @@ public abstract class ByteSource { + + @Override + public String toString() { +- return ByteSource.this.toString() + ".slice(" + offset + ", " + length + ")"; ++ return ByteSource.this + ".slice(" + offset + ", " + length + ")"; + } + } + +@@ -618,9 +618,9 @@ public abstract class ByteSource { + return Arrays.copyOfRange(bytes, offset, offset + length); + } + +- @SuppressWarnings("CheckReturnValue") // it doesn't matter what processBytes returns here +- @Override ++ @Override // it doesn't matter what processBytes returns here + @ParametricNullness ++ @SuppressWarnings("CheckReturnValue") + public T read(ByteProcessor processor) throws IOException { + processor.processBytes(bytes, offset, length); + return processor.getResult(); +diff --git a/guava/src/com/google/common/io/ByteStreams.java b/guava/src/com/google/common/io/ByteStreams.java +index 99213bf16b..a35c255f68 100644 +--- a/guava/src/com/google/common/io/ByteStreams.java ++++ b/guava/src/com/google/common/io/ByteStreams.java +@@ -282,8 +282,8 @@ public final class ByteStreams { + * + * @since 20.0 + */ +- @CanIgnoreReturnValue + @Beta ++ @CanIgnoreReturnValue + public static long exhaust(InputStream in) throws IOException { + long total = 0; + long read; +@@ -454,8 +454,8 @@ public final class ByteStreams { + } + } + +- @Override + @CheckForNull ++ @Override + public String readLine() { + try { + return input.readLine(); +diff --git a/guava/src/com/google/common/io/CharSource.java b/guava/src/com/google/common/io/CharSource.java +index 24a67af5c6..d2a98af99d 100644 +--- a/guava/src/com/google/common/io/CharSource.java ++++ b/guava/src/com/google/common/io/CharSource.java +@@ -531,7 +531,7 @@ public abstract class CharSource { + + @Override + public String toString() { +- return CharSource.this.toString() + ".asByteSource(" + charset + ")"; ++ return CharSource.this + ".asByteSource(" + charset + ")"; + } + } + +@@ -578,8 +578,8 @@ public abstract class CharSource { + return new AbstractIterator() { + Iterator lines = LINE_SPLITTER.split(seq).iterator(); + +- @Override + @CheckForNull ++ @Override + protected String computeNext() { + if (lines.hasNext()) { + String next = lines.next(); +@@ -598,8 +598,8 @@ public abstract class CharSource { + return Streams.stream(linesIterator()); + } + +- @Override + @CheckForNull ++ @Override + public String readFirstLine() { + Iterator lines = linesIterator(); + return lines.hasNext() ? lines.next() : null; +diff --git a/guava/src/com/google/common/io/FileBackedOutputStream.java b/guava/src/com/google/common/io/FileBackedOutputStream.java +index 9912e2fcd1..4f3bcc65e0 100644 +--- a/guava/src/com/google/common/io/FileBackedOutputStream.java ++++ b/guava/src/com/google/common/io/FileBackedOutputStream.java +@@ -82,8 +82,8 @@ public final class FileBackedOutputStream extends OutputStream { + } + + /** Returns the file holding the data (possibly null). */ +- @VisibleForTesting + @CheckForNull ++ @VisibleForTesting + synchronized File getFile() { + return file; + } +diff --git a/guava/src/com/google/common/io/Files.java b/guava/src/com/google/common/io/Files.java +index 4ecab28074..0f031fa60b 100644 +--- a/guava/src/com/google/common/io/Files.java ++++ b/guava/src/com/google/common/io/Files.java +@@ -17,6 +17,7 @@ package com.google.common.io; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.io.FileWriteMode.APPEND; ++import static java.util.Collections.unmodifiableList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; +@@ -51,7 +52,6 @@ import java.nio.charset.Charset; + import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import javax.annotation.CheckForNull; + import org.checkerframework.checker.nullness.qual.Nullable; +@@ -358,7 +358,7 @@ public final class Files { + @Deprecated + @InlineMe( + replacement = "Files.asCharSink(to, charset, FileWriteMode.APPEND).write(from)", +- imports = {"com.google.common.io.FileWriteMode", "com.google.common.io.Files"}) ++ imports = {"com.google.common.io.Files", "com.google.common.io.FileWriteMode"}) + public static void append(CharSequence from, File to, Charset charset) throws IOException { + asCharSink(to, charset, FileWriteMode.APPEND).write(from); + } +@@ -523,11 +523,11 @@ public final class Files { + * @throws IOException if an I/O error occurs + * @deprecated Prefer {@code asCharSource(file, charset).readFirstLine()}. + */ ++ @CheckForNull + @Deprecated + @InlineMe( + replacement = "Files.asCharSource(file, charset).readFirstLine()", + imports = "com.google.common.io.Files") +- @CheckForNull + public static String readFirstLine(File file, Charset charset) throws IOException { + return asCharSource(file, charset).readFirstLine(); + } +@@ -581,11 +581,11 @@ public final class Files { + * @throws IOException if an I/O error occurs + * @deprecated Prefer {@code asCharSource(file, charset).readLines(callback)}. + */ ++ @CanIgnoreReturnValue + @Deprecated + @InlineMe( + replacement = "Files.asCharSource(file, charset).readLines(callback)", +- imports = "com.google.common.io.Files") +- @CanIgnoreReturnValue // some processors won't return a useful result ++ imports = "com.google.common.io.Files") // some processors won't return a useful result + @ParametricNullness + public static T readLines( + File file, Charset charset, LineProcessor callback) throws IOException { +@@ -603,11 +603,11 @@ public final class Files { + * @throws IOException if an I/O error occurs + * @deprecated Prefer {@code asByteSource(file).read(processor)}. + */ ++ @CanIgnoreReturnValue + @Deprecated + @InlineMe( + replacement = "Files.asByteSource(file).read(processor)", +- imports = "com.google.common.io.Files") +- @CanIgnoreReturnValue // some processors won't return a useful result ++ imports = "com.google.common.io.Files") // some processors won't return a useful result + @ParametricNullness + public static T readBytes(File file, ByteProcessor processor) + throws IOException { +@@ -854,7 +854,7 @@ public final class Files { + if (file.isDirectory()) { + File[] files = file.listFiles(); + if (files != null) { +- return Collections.unmodifiableList(Arrays.asList(files)); ++ return unmodifiableList(Arrays.asList(files)); + } + } + +diff --git a/guava/src/com/google/common/io/LittleEndianDataInputStream.java b/guava/src/com/google/common/io/LittleEndianDataInputStream.java +index 88c8e27bc3..2293b084fd 100644 +--- a/guava/src/com/google/common/io/LittleEndianDataInputStream.java ++++ b/guava/src/com/google/common/io/LittleEndianDataInputStream.java +@@ -14,9 +14,10 @@ + + package com.google.common.io; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.primitives.Ints; + import com.google.common.primitives.Longs; + import com.google.errorprone.annotations.CanIgnoreReturnValue; +@@ -50,13 +51,13 @@ public final class LittleEndianDataInputStream extends FilterInputStream impleme + * @param in the stream to delegate to + */ + public LittleEndianDataInputStream(InputStream in) { +- super(Preconditions.checkNotNull(in)); ++ super(checkNotNull(in)); + } + + /** This method will throw an {@link UnsupportedOperationException}. */ + @CanIgnoreReturnValue // to skip a line +- @Override + @DoNotCall("Always throws UnsupportedOperationException") ++ @Override + public String readLine() { + throw new UnsupportedOperationException("readLine is not supported"); + } +diff --git a/guava/src/com/google/common/io/LittleEndianDataOutputStream.java b/guava/src/com/google/common/io/LittleEndianDataOutputStream.java +index 6e51aff49d..3d079b7bc3 100644 +--- a/guava/src/com/google/common/io/LittleEndianDataOutputStream.java ++++ b/guava/src/com/google/common/io/LittleEndianDataOutputStream.java +@@ -14,9 +14,10 @@ + + package com.google.common.io; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.primitives.Longs; + import java.io.DataOutput; + import java.io.DataOutputStream; +@@ -46,7 +47,7 @@ public final class LittleEndianDataOutputStream extends FilterOutputStream imple + * @param out the stream to delegate to + */ + public LittleEndianDataOutputStream(OutputStream out) { +- super(new DataOutputStream(Preconditions.checkNotNull(out))); ++ super(new DataOutputStream(checkNotNull(out))); + } + + @Override +diff --git a/guava/src/com/google/common/io/MoreFiles.java b/guava/src/com/google/common/io/MoreFiles.java +index ffe200d5e8..06fe965b75 100644 +--- a/guava/src/com/google/common/io/MoreFiles.java ++++ b/guava/src/com/google/common/io/MoreFiles.java +@@ -172,8 +172,8 @@ public final class MoreFiles { + // overload taking OpenOptions, meaning we can't guarantee the same behavior w.r.t. things + // like following/not following symlinks. + return new AsCharSource(charset) { +- @SuppressWarnings("FilesLinesLeak") // the user needs to close it in this case +- @Override ++ @Override // the user needs to close it in this case ++ @SuppressWarnings("FilesLinesLeak") + public Stream lines() throws IOException { + return Files.lines(path, charset); + } +diff --git a/guava/src/com/google/common/io/MultiReader.java b/guava/src/com/google/common/io/MultiReader.java +index cc36e527b6..59f906ca8a 100644 +--- a/guava/src/com/google/common/io/MultiReader.java ++++ b/guava/src/com/google/common/io/MultiReader.java +@@ -14,10 +14,10 @@ + + package com.google.common.io; + ++import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import java.io.IOException; + import java.io.Reader; + import java.util.Iterator; +@@ -64,7 +64,7 @@ class MultiReader extends Reader { + + @Override + public long skip(long n) throws IOException { +- Preconditions.checkArgument(n >= 0, "n is negative"); ++ checkArgument(n >= 0, "n is negative"); + if (n > 0) { + while (current != null) { + long result = current.skip(n); +diff --git a/guava/src/com/google/common/io/PatternFilenameFilter.java b/guava/src/com/google/common/io/PatternFilenameFilter.java +index 3cb2371e2f..6f50e174af 100644 +--- a/guava/src/com/google/common/io/PatternFilenameFilter.java ++++ b/guava/src/com/google/common/io/PatternFilenameFilter.java +@@ -14,9 +14,10 @@ + + package com.google.common.io; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import java.io.File; + import java.io.FilenameFilter; + import java.util.regex.Pattern; +@@ -52,7 +53,7 @@ public final class PatternFilenameFilter implements FilenameFilter { + * @param pattern the pattern on which to filter file names + */ + public PatternFilenameFilter(Pattern pattern) { +- this.pattern = Preconditions.checkNotNull(pattern); ++ this.pattern = checkNotNull(pattern); + } + + /* +diff --git a/guava/src/com/google/common/math/DoubleMath.java b/guava/src/com/google/common/math/DoubleMath.java +index cdd0a4b39e..933247139a 100644 +--- a/guava/src/com/google/common/math/DoubleMath.java ++++ b/guava/src/com/google/common/math/DoubleMath.java +@@ -518,8 +518,8 @@ public final class DoubleMath { + return mean; + } + +- @GwtIncompatible // com.google.common.math.DoubleUtils +- @CanIgnoreReturnValue ++ @CanIgnoreReturnValue // com.google.common.math.DoubleUtils ++ @GwtIncompatible + private static double checkFinite(double argument) { + checkArgument(isFinite(argument)); + return argument; +diff --git a/guava/src/com/google/common/math/IntMath.java b/guava/src/com/google/common/math/IntMath.java +index 17a18c6999..2f309ca39d 100644 +--- a/guava/src/com/google/common/math/IntMath.java ++++ b/guava/src/com/google/common/math/IntMath.java +@@ -719,8 +719,8 @@ public final class IntMath { + * @throws IllegalArgumentException if {@code n} is negative + * @since 20.0 + */ +- @GwtIncompatible // TODO +- @Beta ++ @Beta // TODO ++ @GwtIncompatible + public static boolean isPrime(int n) { + return LongMath.isPrime(n); + } +diff --git a/guava/src/com/google/common/math/LongMath.java b/guava/src/com/google/common/math/LongMath.java +index dd5ff06942..2ba232cd06 100644 +--- a/guava/src/com/google/common/math/LongMath.java ++++ b/guava/src/com/google/common/math/LongMath.java +@@ -999,8 +999,8 @@ public final class LongMath { + * @throws IllegalArgumentException if {@code n} is negative + * @since 20.0 + */ +- @GwtIncompatible // TODO +- @Beta ++ @Beta // TODO ++ @GwtIncompatible + public static boolean isPrime(long n) { + if (n < 2) { + checkNonNegative("n", n); +@@ -1242,8 +1242,8 @@ public final class LongMath { + * is not precisely representable as a {@code double} + * @since 30.0 + */ +- @SuppressWarnings("deprecation") + @GwtIncompatible ++ @SuppressWarnings("deprecation") + public static double roundToDouble(long x, RoundingMode mode) { + // Logic adapted from ToDoubleRounder. + double roundArbitrarily = (double) x; +diff --git a/guava/src/com/google/common/net/HostSpecifier.java b/guava/src/com/google/common/net/HostSpecifier.java +index c57f3d9759..ae6d1ab67d 100644 +--- a/guava/src/com/google/common/net/HostSpecifier.java ++++ b/guava/src/com/google/common/net/HostSpecifier.java +@@ -14,8 +14,9 @@ + + package com.google.common.net; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.net.InetAddress; + import java.text.ParseException; +@@ -71,7 +72,7 @@ public final class HostSpecifier { + // Verify that no port was specified, and strip optional brackets from + // IPv6 literals. + HostAndPort parsedHost = HostAndPort.fromString(specifier); +- Preconditions.checkArgument(!parsedHost.hasPort()); ++ checkArgument(!parsedHost.hasPort()); + String host = parsedHost.getHost(); + + // Try to interpret the specifier as an IP address. Note we build +diff --git a/guava/src/com/google/common/net/PercentEscaper.java b/guava/src/com/google/common/net/PercentEscaper.java +index 9290147312..f386d96bce 100644 +--- a/guava/src/com/google/common/net/PercentEscaper.java ++++ b/guava/src/com/google/common/net/PercentEscaper.java +@@ -154,8 +154,8 @@ public final class PercentEscaper extends UnicodeEscaper { + } + + /** Escapes the given Unicode code point in UTF-8. */ +- @Override + @CheckForNull ++ @Override + protected char[] escape(int cp) { + // We should never get negative values here but if we do it will throw an + // IndexOutOfBoundsException, so at least it will get spotted. +diff --git a/guava/src/com/google/common/primitives/Booleans.java b/guava/src/com/google/common/primitives/Booleans.java +index 522049bfe3..a54c2186b9 100644 +--- a/guava/src/com/google/common/primitives/Booleans.java ++++ b/guava/src/com/google/common/primitives/Booleans.java +@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -25,7 +26,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -370,7 +370,7 @@ public final class Booleans { + */ + public static List asList(boolean... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new BooleanArrayAsList(backingArray); + } +@@ -453,7 +453,7 @@ public final class Booleans { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new BooleanArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/primitives/Bytes.java b/guava/src/com/google/common/primitives/Bytes.java +index 62997f34aa..b0e76f4f2e 100644 +--- a/guava/src/com/google/common/primitives/Bytes.java ++++ b/guava/src/com/google/common/primitives/Bytes.java +@@ -18,13 +18,13 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.GwtCompatible; + import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.List; + import java.util.RandomAccess; + import javax.annotation.CheckForNull; +@@ -232,7 +232,7 @@ public final class Bytes { + */ + public static List asList(byte... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new ByteArrayAsList(backingArray); + } +@@ -314,7 +314,7 @@ public final class Bytes { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new ByteArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/primitives/Chars.java b/guava/src/com/google/common/primitives/Chars.java +index 4a2e3a3449..4490e95572 100644 +--- a/guava/src/com/google/common/primitives/Chars.java ++++ b/guava/src/com/google/common/primitives/Chars.java +@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -26,7 +27,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -502,7 +502,7 @@ public final class Chars { + */ + public static List asList(char... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new CharArrayAsList(backingArray); + } +@@ -585,7 +585,7 @@ public final class Chars { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new CharArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/primitives/Doubles.java b/guava/src/com/google/common/primitives/Doubles.java +index 6b621c5130..6060357f55 100644 +--- a/guava/src/com/google/common/primitives/Doubles.java ++++ b/guava/src/com/google/common/primitives/Doubles.java +@@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkPositionIndexes; + import static com.google.common.base.Strings.lenientFormat; + import static java.lang.Double.NEGATIVE_INFINITY; + import static java.lang.Double.POSITIVE_INFINITY; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -30,7 +31,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -517,7 +517,7 @@ public final class Doubles extends DoublesMethodsForWeb { + */ + public static List asList(double... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new DoubleArrayAsList(backingArray); + } +@@ -605,7 +605,7 @@ public final class Doubles extends DoublesMethodsForWeb { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new DoubleArrayAsList(array, start + fromIndex, start + toIndex); + } +@@ -699,8 +699,8 @@ public final class Doubles extends DoublesMethodsForWeb { + * @since 14.0 + */ + @Beta +- @GwtIncompatible // regular expressions +- @CheckForNull ++ @CheckForNull // regular expressions ++ @GwtIncompatible + public static Double tryParse(String string) { + if (FLOATING_POINT_PATTERN.matcher(string).matches()) { + // TODO(lowasser): could be potentially optimized, but only with +diff --git a/guava/src/com/google/common/primitives/Floats.java b/guava/src/com/google/common/primitives/Floats.java +index b038cb2896..a6f3859e1d 100644 +--- a/guava/src/com/google/common/primitives/Floats.java ++++ b/guava/src/com/google/common/primitives/Floats.java +@@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkPositionIndexes; + import static com.google.common.base.Strings.lenientFormat; + import static java.lang.Float.NEGATIVE_INFINITY; + import static java.lang.Float.POSITIVE_INFINITY; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -30,7 +31,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -509,7 +509,7 @@ public final class Floats extends FloatsMethodsForWeb { + */ + public static List asList(float... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new FloatArrayAsList(backingArray); + } +@@ -591,7 +591,7 @@ public final class Floats extends FloatsMethodsForWeb { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new FloatArrayAsList(array, start + fromIndex, start + toIndex); + } +@@ -661,8 +661,8 @@ public final class Floats extends FloatsMethodsForWeb { + * @since 14.0 + */ + @Beta +- @GwtIncompatible // regular expressions +- @CheckForNull ++ @CheckForNull // regular expressions ++ @GwtIncompatible + public static Float tryParse(String string) { + if (Doubles.FLOATING_POINT_PATTERN.matcher(string).matches()) { + // TODO(lowasser): could be potentially optimized, but only with +diff --git a/guava/src/com/google/common/primitives/ImmutableDoubleArray.java b/guava/src/com/google/common/primitives/ImmutableDoubleArray.java +index 9731c11315..3b02853f6c 100644 +--- a/guava/src/com/google/common/primitives/ImmutableDoubleArray.java ++++ b/guava/src/com/google/common/primitives/ImmutableDoubleArray.java +@@ -15,11 +15,12 @@ + package com.google.common.primitives; + + import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndexes; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.errorprone.annotations.CheckReturnValue; + import com.google.errorprone.annotations.Immutable; +@@ -372,7 +373,7 @@ public final class ImmutableDoubleArray implements Serializable { + * {@link #length} + */ + public double get(int index) { +- Preconditions.checkElementIndex(index, length()); ++ checkElementIndex(index, length()); + return array[start + index]; + } + +@@ -438,7 +439,7 @@ public final class ImmutableDoubleArray implements Serializable { + * end).trimmed()}. + */ + public ImmutableDoubleArray subArray(int startIndex, int endIndex) { +- Preconditions.checkPositionIndexes(startIndex, endIndex, length()); ++ checkPositionIndexes(startIndex, endIndex, length()); + return startIndex == endIndex + ? EMPTY + : new ImmutableDoubleArray(array, start + startIndex, start + endIndex); +diff --git a/guava/src/com/google/common/primitives/ImmutableIntArray.java b/guava/src/com/google/common/primitives/ImmutableIntArray.java +index cc3c671442..d38fe89470 100644 +--- a/guava/src/com/google/common/primitives/ImmutableIntArray.java ++++ b/guava/src/com/google/common/primitives/ImmutableIntArray.java +@@ -15,11 +15,12 @@ + package com.google.common.primitives; + + import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndexes; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.errorprone.annotations.CheckReturnValue; + import com.google.errorprone.annotations.Immutable; +@@ -369,7 +370,7 @@ public final class ImmutableIntArray implements Serializable { + * {@link #length} + */ + public int get(int index) { +- Preconditions.checkElementIndex(index, length()); ++ checkElementIndex(index, length()); + return array[start + index]; + } + +@@ -433,7 +434,7 @@ public final class ImmutableIntArray implements Serializable { + * end).trimmed()}. + */ + public ImmutableIntArray subArray(int startIndex, int endIndex) { +- Preconditions.checkPositionIndexes(startIndex, endIndex, length()); ++ checkPositionIndexes(startIndex, endIndex, length()); + return startIndex == endIndex + ? EMPTY + : new ImmutableIntArray(array, start + startIndex, start + endIndex); +diff --git a/guava/src/com/google/common/primitives/ImmutableLongArray.java b/guava/src/com/google/common/primitives/ImmutableLongArray.java +index c8f70375d2..c1d4d61129 100644 +--- a/guava/src/com/google/common/primitives/ImmutableLongArray.java ++++ b/guava/src/com/google/common/primitives/ImmutableLongArray.java +@@ -15,11 +15,12 @@ + package com.google.common.primitives; + + import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkPositionIndexes; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.errorprone.annotations.CheckReturnValue; + import com.google.errorprone.annotations.Immutable; +@@ -371,7 +372,7 @@ public final class ImmutableLongArray implements Serializable { + * {@link #length} + */ + public long get(int index) { +- Preconditions.checkElementIndex(index, length()); ++ checkElementIndex(index, length()); + return array[start + index]; + } + +@@ -435,7 +436,7 @@ public final class ImmutableLongArray implements Serializable { + * end).trimmed()}. + */ + public ImmutableLongArray subArray(int startIndex, int endIndex) { +- Preconditions.checkPositionIndexes(startIndex, endIndex, length()); ++ checkPositionIndexes(startIndex, endIndex, length()); + return startIndex == endIndex + ? EMPTY + : new ImmutableLongArray(array, start + startIndex, start + endIndex); +diff --git a/guava/src/com/google/common/primitives/Ints.java b/guava/src/com/google/common/primitives/Ints.java +index b63b0f946e..490f99ef37 100644 +--- a/guava/src/com/google/common/primitives/Ints.java ++++ b/guava/src/com/google/common/primitives/Ints.java +@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -27,7 +28,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -557,7 +557,7 @@ public final class Ints extends IntsMethodsForWeb { + */ + public static List asList(int... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new IntArrayAsList(backingArray); + } +@@ -644,7 +644,7 @@ public final class Ints extends IntsMethodsForWeb { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new IntArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/primitives/Longs.java b/guava/src/com/google/common/primitives/Longs.java +index 98c055e27a..de21b161c4 100644 +--- a/guava/src/com/google/common/primitives/Longs.java ++++ b/guava/src/com/google/common/primitives/Longs.java +@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -26,7 +27,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -653,7 +653,7 @@ public final class Longs { + */ + public static List asList(long... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new LongArrayAsList(backingArray); + } +@@ -740,7 +740,7 @@ public final class Longs { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new LongArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/primitives/Primitives.java b/guava/src/com/google/common/primitives/Primitives.java +index 7ceed03655..9f875990ad 100644 +--- a/guava/src/com/google/common/primitives/Primitives.java ++++ b/guava/src/com/google/common/primitives/Primitives.java +@@ -15,9 +15,9 @@ + package com.google.common.primitives; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.unmodifiableMap; + + import com.google.common.annotations.GwtIncompatible; +-import java.util.Collections; + import java.util.LinkedHashMap; + import java.util.Map; + import java.util.Set; +@@ -56,8 +56,8 @@ public final class Primitives { + add(primToWrap, wrapToPrim, short.class, Short.class); + add(primToWrap, wrapToPrim, void.class, Void.class); + +- PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap); +- WRAPPER_TO_PRIMITIVE_TYPE = Collections.unmodifiableMap(wrapToPrim); ++ PRIMITIVE_TO_WRAPPER_TYPE = unmodifiableMap(primToWrap); ++ WRAPPER_TO_PRIMITIVE_TYPE = unmodifiableMap(wrapToPrim); + } + + private static void add( +diff --git a/guava/src/com/google/common/primitives/Shorts.java b/guava/src/com/google/common/primitives/Shorts.java +index 09e0f7cfc3..189acb5f5a 100644 +--- a/guava/src/com/google/common/primitives/Shorts.java ++++ b/guava/src/com/google/common/primitives/Shorts.java +@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Preconditions.checkPositionIndexes; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -27,7 +28,6 @@ import java.io.Serializable; + import java.util.AbstractList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.Comparator; + import java.util.List; + import java.util.RandomAccess; +@@ -554,7 +554,7 @@ public final class Shorts extends ShortsMethodsForWeb { + */ + public static List asList(short... backingArray) { + if (backingArray.length == 0) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new ShortArrayAsList(backingArray); + } +@@ -636,7 +636,7 @@ public final class Shorts extends ShortsMethodsForWeb { + int size = size(); + checkPositionIndexes(fromIndex, toIndex, size); + if (fromIndex == toIndex) { +- return Collections.emptyList(); ++ return emptyList(); + } + return new ShortArrayAsList(array, start + fromIndex, start + toIndex); + } +diff --git a/guava/src/com/google/common/reflect/AbstractInvocationHandler.java b/guava/src/com/google/common/reflect/AbstractInvocationHandler.java +index ff921959db..f8b97b7e37 100644 +--- a/guava/src/com/google/common/reflect/AbstractInvocationHandler.java ++++ b/guava/src/com/google/common/reflect/AbstractInvocationHandler.java +@@ -58,8 +58,8 @@ public abstract class AbstractInvocationHandler implements InvocationHandler { + *

  • other method calls are dispatched to {@link #handleInvocation}. + * + */ +- @Override + @CheckForNull ++ @Override + public final Object invoke(Object proxy, Method method, @CheckForNull @Nullable Object[] args) + throws Throwable { + if (args == null) { +diff --git a/guava/src/com/google/common/reflect/ImmutableTypeToInstanceMap.java b/guava/src/com/google/common/reflect/ImmutableTypeToInstanceMap.java +index 6273704a10..16ba194811 100644 +--- a/guava/src/com/google/common/reflect/ImmutableTypeToInstanceMap.java ++++ b/guava/src/com/google/common/reflect/ImmutableTypeToInstanceMap.java +@@ -100,14 +100,14 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap T getInstance(TypeToken type) { + return trustedGet(type.rejectTypeVariables()); + } + +- @Override + @CheckForNull ++ @Override + public T getInstance(Class type) { + return trustedGet(TypeToken.of(type)); + } +@@ -119,10 +119,10 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap T putInstance(TypeToken type, T value) { + throw new UnsupportedOperationException(); + } +@@ -134,10 +134,10 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap T putInstance(Class type, T value) { + throw new UnsupportedOperationException(); + } +@@ -149,10 +149,10 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap key, B value) { + throw new UnsupportedOperationException(); + } +@@ -164,8 +164,8 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap, ? extends B> map) { + throw new UnsupportedOperationException(); + } +@@ -175,8 +175,8 @@ public final class ImmutableTypeToInstanceMap extends ForwardingMap T trustedGet(TypeToken type) { + return (T) delegate.get(type); + } +diff --git a/guava/src/com/google/common/reflect/Invokable.java b/guava/src/com/google/common/reflect/Invokable.java +index e6d3b6c53f..6b92499bd4 100644 +--- a/guava/src/com/google/common/reflect/Invokable.java ++++ b/guava/src/com/google/common/reflect/Invokable.java +@@ -90,8 +90,8 @@ public abstract class Invokable implements AnnotatedElement, Member { + return accessibleObject.isAnnotationPresent(annotationClass); + } + +- @Override + @CheckForNull ++ @Override + public final A getAnnotation(Class annotationClass) { + return accessibleObject.getAnnotation(annotationClass); + } +@@ -253,9 +253,9 @@ public abstract class Invokable implements AnnotatedElement, Member { + * @throws InvocationTargetException if the underlying method or constructor throws an exception. + */ + // All subclasses are owned by us and we'll make sure to get the R type right, including nullness. +- @SuppressWarnings({"unchecked", "nullness"}) + @CanIgnoreReturnValue + @CheckForNull ++ @SuppressWarnings({"nullness", "unchecked"}) + public final R invoke(@CheckForNull T receiver, @Nullable Object... args) + throws InvocationTargetException, IllegalAccessException { + return (R) invokeInternal(receiver, checkNotNull(args)); +@@ -322,8 +322,8 @@ public abstract class Invokable implements AnnotatedElement, Member { + return specialized; + } + +- @SuppressWarnings("unchecked") // The declaring class is T's raw class, or one of its supertypes. +- @Override ++ @Override // The declaring class is T's raw class, or one of its supertypes. ++ @SuppressWarnings("unchecked") + public final Class getDeclaringClass() { + return (Class) member.getDeclaringClass(); + } +@@ -361,8 +361,8 @@ public abstract class Invokable implements AnnotatedElement, Member { + this.method = method; + } + +- @Override + @CheckForNull ++ @Override + final Object invokeInternal(@CheckForNull Object receiver, @Nullable Object[] args) + throws InvocationTargetException, IllegalAccessException { + return method.invoke(receiver, args); +diff --git a/guava/src/com/google/common/reflect/MutableTypeToInstanceMap.java b/guava/src/com/google/common/reflect/MutableTypeToInstanceMap.java +index 9542e0a7ed..9b3bd5b30f 100644 +--- a/guava/src/com/google/common/reflect/MutableTypeToInstanceMap.java ++++ b/guava/src/com/google/common/reflect/MutableTypeToInstanceMap.java +@@ -44,28 +44,28 @@ public final class MutableTypeToInstanceMap extends ForwardingMap, B> backingMap = Maps.newHashMap(); + +- @Override + @CheckForNull ++ @Override + public T getInstance(Class type) { + return trustedGet(TypeToken.of(type)); + } + +- @Override + @CheckForNull ++ @Override + public T getInstance(TypeToken type) { + return trustedGet(type.rejectTypeVariables()); + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public T putInstance(Class type, T value) { + return trustedPut(TypeToken.of(type), value); + } + +- @Override + @CanIgnoreReturnValue + @CheckForNull ++ @Override + public T putInstance(TypeToken type, T value) { + return trustedPut(type.rejectTypeVariables(), value); + } +@@ -77,10 +77,10 @@ public final class MutableTypeToInstanceMap extends ForwardingMap key, B value) { + throw new UnsupportedOperationException("Please use putInstance() instead."); + } +@@ -92,8 +92,8 @@ public final class MutableTypeToInstanceMap extends ForwardingMap, ? extends B> map) { + throw new UnsupportedOperationException("Please use putInstance() instead."); + } +@@ -108,14 +108,14 @@ public final class MutableTypeToInstanceMap extends ForwardingMap T trustedPut(TypeToken type, T value) { + return (T) backingMap.put(type, value); + } + +- @SuppressWarnings("unchecked") // value could not get in if not a T +- @CheckForNull ++ @CheckForNull // value could not get in if not a T ++ @SuppressWarnings("unchecked") + private T trustedGet(TypeToken type) { + return (T) backingMap.get(type); + } +diff --git a/guava/src/com/google/common/reflect/Parameter.java b/guava/src/com/google/common/reflect/Parameter.java +index 5ef6606ea2..c11798ff6b 100644 +--- a/guava/src/com/google/common/reflect/Parameter.java ++++ b/guava/src/com/google/common/reflect/Parameter.java +@@ -73,8 +73,8 @@ public final class Parameter implements AnnotatedElement { + return getAnnotation(annotationType) != null; + } + +- @Override + @CheckForNull ++ @Override + public A getAnnotation(Class annotationType) { + checkNotNull(annotationType); + for (Annotation annotation : annotations) { +@@ -112,8 +112,8 @@ public final class Parameter implements AnnotatedElement { + * @since 18.0 + */ + // @Override on JDK8 +- @Override + @CheckForNull ++ @Override + public A getDeclaredAnnotation(Class annotationType) { + checkNotNull(annotationType); + return FluentIterable.from(annotations).filter(annotationType).first().orNull(); +diff --git a/guava/src/com/google/common/reflect/TypeToken.java b/guava/src/com/google/common/reflect/TypeToken.java +index fea1d53a2f..c50c0d8c71 100644 +--- a/guava/src/com/google/common/reflect/TypeToken.java ++++ b/guava/src/com/google/common/reflect/TypeToken.java +@@ -692,7 +692,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + ImmutableSet> filteredTypes = types; + if (filteredTypes == null) { + // Java has no way to express ? super T when we parameterize TypeToken vs. Class. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableList> collectedTypes = + (ImmutableList) TypeCollector.FOR_GENERIC_TYPE.collectTypes(TypeToken.this); + return (types = +@@ -707,7 +707,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + /** Returns the raw types of the types in this set, in the same order. */ + public Set> rawTypes() { + // Java has no way to express ? super T when we parameterize TypeToken vs. Class. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableList> collectedTypes = + (ImmutableList) TypeCollector.FOR_RAW_TYPE.collectTypes(getRawTypes()); + return ImmutableSet.copyOf(collectedTypes); +@@ -744,7 +744,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + @Override + public Set> rawTypes() { + // Java has no way to express ? super T when we parameterize TypeToken vs. Class. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableList> collectedTypes = + (ImmutableList) TypeCollector.FOR_RAW_TYPE.collectTypes(getRawTypes()); + return FluentIterable.from(collectedTypes).filter(Class::isInterface).toSet(); +@@ -770,7 +770,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + protected Set> delegate() { + ImmutableSet> result = classes; + if (result == null) { +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableList> collectedTypes = + (ImmutableList) + TypeCollector.FOR_GENERIC_TYPE.classesOnly().collectTypes(TypeToken.this); +@@ -791,7 +791,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + @Override + public Set> rawTypes() { + // Java has no way to express ? super T when we parameterize TypeToken vs. Class. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableList> collectedTypes = + (ImmutableList) TypeCollector.FOR_RAW_TYPE.classesOnly().collectTypes(getRawTypes()); + return ImmutableSet.copyOf(collectedTypes); +@@ -1124,7 +1124,7 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + } + }.visit(runtimeType); + // Cast from ImmutableSet> to ImmutableSet> +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + ImmutableSet> result = (ImmutableSet) builder.build(); + return result; + } +@@ -1334,8 +1334,8 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + return type.getGenericInterfaces(); + } + +- @Override + @CheckForNull ++ @Override + TypeToken getSuperclass(TypeToken type) { + return type.getGenericSuperclass(); + } +@@ -1353,8 +1353,8 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + return Arrays.asList(type.getInterfaces()); + } + +- @Override + @CheckForNull ++ @Override + Class getSuperclass(Class type) { + return type.getSuperclass(); + } +@@ -1459,8 +1459,8 @@ public abstract class TypeToken extends TypeCapture implements Serializabl + return delegate.getInterfaces(type); + } + +- @Override + @CheckForNull ++ @Override + K getSuperclass(K type) { + return delegate.getSuperclass(type); + } +diff --git a/guava/src/com/google/common/reflect/Types.java b/guava/src/com/google/common/reflect/Types.java +index e69b42a8e8..25a02d75b8 100644 +--- a/guava/src/com/google/common/reflect/Types.java ++++ b/guava/src/com/google/common/reflect/Types.java +@@ -16,6 +16,7 @@ package com.google.common.reflect; + + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Predicates.not; + import static com.google.common.collect.Iterables.transform; + import static java.util.Objects.requireNonNull; + +@@ -99,15 +100,15 @@ final class Types { + /** Decides what owner type to use for constructing {@link ParameterizedType} from a raw class. */ + private enum ClassOwnership { + OWNED_BY_ENCLOSING_CLASS { +- @Override + @CheckForNull ++ @Override + Class getOwnerType(Class rawType) { + return rawType.getEnclosingClass(); + } + }, + LOCAL_CLASS_HAS_NO_OWNER { +- @Override + @CheckForNull ++ @Override + Class getOwnerType(Class rawType) { + if (rawType.isLocalClass()) { + return null; +@@ -279,8 +280,8 @@ final class Types { + return rawType; + } + +- @Override + @CheckForNull ++ @Override + public Type getOwnerType() { + return ownerType; + } +@@ -381,8 +382,8 @@ final class Types { + this.typeVariableImpl = typeVariableImpl; + } + +- @Override + @CheckForNull ++ @Override + public Object invoke(Object proxy, Method method, @CheckForNull @Nullable Object[] args) + throws Throwable { + String methodName = method.getName(); +@@ -522,7 +523,7 @@ final class Types { + } + + private static Iterable filterUpperBounds(Iterable bounds) { +- return Iterables.filter(bounds, Predicates.not(Predicates.equalTo(Object.class))); ++ return Iterables.filter(bounds, not(Predicates.equalTo(Object.class))); + } + + private static void disallowPrimitiveType(Type[] types, String usedAs) { +diff --git a/guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java b/guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java +index 76eada2140..0a56befc1d 100644 +--- a/guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java ++++ b/guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java +@@ -142,8 +142,8 @@ abstract class AbstractCatchingFuture< + setResult(fallbackResult); + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + ListenableFuture localInputFuture = inputFuture; + Class localExceptionType = exceptionType; +diff --git a/guava/src/com/google/common/util/concurrent/AbstractFuture.java b/guava/src/com/google/common/util/concurrent/AbstractFuture.java +index fc408a92d2..71519daccb 100644 +--- a/guava/src/com/google/common/util/concurrent/AbstractFuture.java ++++ b/guava/src/com/google/common/util/concurrent/AbstractFuture.java +@@ -67,12 +67,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; + * @author Luke Sandberg + * @since 1.0 + */ +-@SuppressWarnings({ +- "ShortCircuitBoolean", // we use non-short circuiting comparisons intentionally +- "nullness", // TODO(b/147136275): Remove once our checker understands & and |. +-}) ++@SuppressWarnings({"nullness", "ShortCircuitBoolean"}) + @GwtCompatible(emulated = true) +-@ReflectionSupport(value = ReflectionSupport.Level.FULL) ++@ReflectionSupport(ReflectionSupport.Level.FULL) + @ElementTypesAreNonnullByDefault + public abstract class AbstractFuture extends InternalFutureFailureAccess + implements ListenableFuture { +@@ -1078,13 +1075,13 @@ public abstract class AbstractFuture extends Interna + * + * @since 27.0 + */ +- @Override ++ @CheckForNull + /* + * We should annotate the superclass, InternalFutureFailureAccess, to say that its copy of this + * method returns @Nullable, too. However, we're not sure if we want to make any changes to that + * class, since it's in a separate artifact that we planned to release only a single version of. + */ +- @CheckForNull ++ @Override + protected final Throwable tryInternalFastPathGetFailure() { + if (this instanceof Trusted) { + Object obj = value; +diff --git a/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java b/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java +index 65d29c38bc..c14b229e4f 100644 +--- a/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java ++++ b/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java +@@ -596,8 +596,8 @@ public abstract class AbstractScheduledService implements Service { + this.service = service; + } + +- @Override + @CheckForNull ++ @Override + public Void call() throws Exception { + wrappedRunnable.run(); + reschedule(); +diff --git a/guava/src/com/google/common/util/concurrent/AbstractTransformFuture.java b/guava/src/com/google/common/util/concurrent/AbstractTransformFuture.java +index 841c1acad0..79d04deced 100644 +--- a/guava/src/com/google/common/util/concurrent/AbstractTransformFuture.java ++++ b/guava/src/com/google/common/util/concurrent/AbstractTransformFuture.java +@@ -184,8 +184,8 @@ abstract class AbstractTransformFuture< + this.function = null; + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + ListenableFuture localInputFuture = inputFuture; + F localFunction = function; +diff --git a/guava/src/com/google/common/util/concurrent/AggregateFuture.java b/guava/src/com/google/common/util/concurrent/AggregateFuture.java +index 6d2ed9c8e8..b7ec706b58 100644 +--- a/guava/src/com/google/common/util/concurrent/AggregateFuture.java ++++ b/guava/src/com/google/common/util/concurrent/AggregateFuture.java +@@ -90,8 +90,8 @@ abstract class AggregateFuture> localFutures = futures; + if (localFutures != null) { +diff --git a/guava/src/com/google/common/util/concurrent/AggregateFutureState.java b/guava/src/com/google/common/util/concurrent/AggregateFutureState.java +index ee23ca021e..332fb45ea8 100644 +--- a/guava/src/com/google/common/util/concurrent/AggregateFutureState.java ++++ b/guava/src/com/google/common/util/concurrent/AggregateFutureState.java +@@ -39,7 +39,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; + * + */ + @GwtCompatible(emulated = true) +-@ReflectionSupport(value = ReflectionSupport.Level.FULL) ++@ReflectionSupport(ReflectionSupport.Level.FULL) + @ElementTypesAreNonnullByDefault + abstract class AggregateFutureState + extends AbstractFuture.TrustedFuture { +diff --git a/guava/src/com/google/common/util/concurrent/AtomicDouble.java b/guava/src/com/google/common/util/concurrent/AtomicDouble.java +index 56360a8703..e843064afc 100644 +--- a/guava/src/com/google/common/util/concurrent/AtomicDouble.java ++++ b/guava/src/com/google/common/util/concurrent/AtomicDouble.java +@@ -55,7 +55,7 @@ import java.util.function.DoubleUnaryOperator; + * @since 11.0 + */ + @GwtIncompatible +-@ReflectionSupport(value = ReflectionSupport.Level.FULL) ++@ReflectionSupport(ReflectionSupport.Level.FULL) + @ElementTypesAreNonnullByDefault + public class AtomicDouble extends Number implements java.io.Serializable { + private static final long serialVersionUID = 0L; +diff --git a/guava/src/com/google/common/util/concurrent/AtomicLongMap.java b/guava/src/com/google/common/util/concurrent/AtomicLongMap.java +index 456b3aceb1..63bf500f68 100644 +--- a/guava/src/com/google/common/util/concurrent/AtomicLongMap.java ++++ b/guava/src/com/google/common/util/concurrent/AtomicLongMap.java +@@ -17,12 +17,12 @@ + package com.google.common.util.concurrent; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static java.util.Collections.unmodifiableMap; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.io.Serializable; +-import java.util.Collections; + import java.util.Map; + import java.util.concurrent.ConcurrentHashMap; + import java.util.concurrent.atomic.AtomicBoolean; +@@ -272,7 +272,7 @@ public final class AtomicLongMap implements Serializable { + } + + private Map createAsMap() { +- return Collections.unmodifiableMap(map); ++ return unmodifiableMap(map); + } + + /** Returns true if this map contains a mapping for the specified key. */ +diff --git a/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java b/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java +index 7989bf3a0a..54db8edc0b 100644 +--- a/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java ++++ b/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java +@@ -15,13 +15,14 @@ + package com.google.common.util.concurrent; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkState; ++import static java.util.Collections.unmodifiableMap; + import static java.util.Objects.requireNonNull; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.base.MoreObjects; +-import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Lists; + import com.google.common.collect.MapMaker; +@@ -31,7 +32,6 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; + import com.google.j2objc.annotations.Weak; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.EnumMap; + import java.util.List; + import java.util.Map; +@@ -324,7 +324,7 @@ public class CycleDetectingLockFactory { + for (int i = 0; i < numKeys - 1; i++) { + nodes.get(i).checkAcquiredLocks(Policies.DISABLED, nodes.subList(i + 1, numKeys)); + } +- return Collections.unmodifiableMap(map); ++ return unmodifiableMap(map); + } + + /** +@@ -606,7 +606,7 @@ public class CycleDetectingLockFactory { + final String lockName; + + LockGraphNode(String lockName) { +- this.lockName = Preconditions.checkNotNull(lockName); ++ this.lockName = checkNotNull(lockName); + } + + String getLockName() { +@@ -635,7 +635,7 @@ public class CycleDetectingLockFactory { + // can happen because multiple locks may share the same LockGraphNode. In + // this situation, throw an IllegalStateException as defined by contract + // described in the documentation of WithExplicitOrdering. +- Preconditions.checkState( ++ checkState( + this != acquiredLock, + "Attempted to acquire multiple locks with the same rank %s", + acquiredLock.getLockName()); +@@ -754,7 +754,7 @@ public class CycleDetectingLockFactory { + + private CycleDetectingReentrantLock(LockGraphNode lockGraphNode, boolean fair) { + super(fair); +- this.lockGraphNode = Preconditions.checkNotNull(lockGraphNode); ++ this.lockGraphNode = checkNotNull(lockGraphNode); + } + + ///// CycleDetectingLock methods. ///// +@@ -837,7 +837,7 @@ public class CycleDetectingLockFactory { + super(fair); + this.readLock = new CycleDetectingReentrantReadLock(this); + this.writeLock = new CycleDetectingReentrantWriteLock(this); +- this.lockGraphNode = Preconditions.checkNotNull(lockGraphNode); ++ this.lockGraphNode = checkNotNull(lockGraphNode); + } + + ///// Overridden ReentrantReadWriteLock methods. ///// +diff --git a/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java b/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java +index 80c7779342..e471b7b202 100644 +--- a/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java ++++ b/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java +@@ -369,8 +369,8 @@ public final class ExecutionSequencer { + } + } + +- @SuppressWarnings("ShortCircuitBoolean") + @Override ++ @SuppressWarnings("ShortCircuitBoolean") + public void run() { + Thread currentThread = Thread.currentThread(); + if (currentThread != submitting) { +diff --git a/guava/src/com/google/common/util/concurrent/FluentFuture.java b/guava/src/com/google/common/util/concurrent/FluentFuture.java +index b47e67927f..b194ed02d0 100644 +--- a/guava/src/com/google/common/util/concurrent/FluentFuture.java ++++ b/guava/src/com/google/common/util/concurrent/FluentFuture.java +@@ -184,8 +184,8 @@ public abstract class FluentFuture + * {@code get()} throws a different kind of exception, that exception itself. + * @param executor the executor that runs {@code fallback} if the input fails + */ +- @Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class") + @Beta ++ @Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class") + public final FluentFuture catching( + Class exceptionType, Function fallback, Executor executor) { + return (FluentFuture) Futures.catching(this, exceptionType, fallback, executor); +@@ -249,8 +249,8 @@ public abstract class FluentFuture + * {@code get()} throws a different kind of exception, that exception itself. + * @param executor the executor that runs {@code fallback} if the input fails + */ +- @Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class") + @Beta ++ @Partially.GwtIncompatible("AVAILABLE but requires exceptionType to be Throwable.class") + public final FluentFuture catchingAsync( + Class exceptionType, AsyncFunction fallback, Executor executor) { + return (FluentFuture) Futures.catchingAsync(this, exceptionType, fallback, executor); +@@ -266,8 +266,8 @@ public abstract class FluentFuture + * @param scheduledExecutor The executor service to enforce the timeout. + * @since 28.0 + */ +- @GwtIncompatible // ScheduledExecutorService +- @Beta ++ @Beta // ScheduledExecutorService ++ @GwtIncompatible + public final FluentFuture withTimeout( + Duration timeout, ScheduledExecutorService scheduledExecutor) { + return withTimeout(toNanosSaturated(timeout), TimeUnit.NANOSECONDS, scheduledExecutor); +@@ -283,9 +283,9 @@ public abstract class FluentFuture + * @param unit the time unit of the time parameter + * @param scheduledExecutor The executor service to enforce the timeout. + */ +- @GwtIncompatible // ScheduledExecutorService +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @Beta ++ @Beta // ScheduledExecutorService ++ @GwtIncompatible // should accept a java.time.Duration ++ @SuppressWarnings("GoodTime") + public final FluentFuture withTimeout( + long timeout, TimeUnit unit, ScheduledExecutorService scheduledExecutor) { + return (FluentFuture) Futures.withTimeout(this, timeout, unit, scheduledExecutor); +diff --git a/guava/src/com/google/common/util/concurrent/ForwardingBlockingDeque.java b/guava/src/com/google/common/util/concurrent/ForwardingBlockingDeque.java +index d0d72a8159..2ee8902208 100644 +--- a/guava/src/com/google/common/util/concurrent/ForwardingBlockingDeque.java ++++ b/guava/src/com/google/common/util/concurrent/ForwardingBlockingDeque.java +@@ -90,14 +90,14 @@ public abstract class ForwardingBlockingDeque extends ForwardingDeque + return delegate().takeLast(); + } + +- @Override + @CheckForNull ++ @Override + public E pollFirst(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().pollFirst(timeout, unit); + } + +- @Override + @CheckForNull ++ @Override + public E pollLast(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().pollLast(timeout, unit); + } +@@ -117,8 +117,8 @@ public abstract class ForwardingBlockingDeque extends ForwardingDeque + return delegate().take(); + } + +- @Override + @CheckForNull ++ @Override + public E poll(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().poll(timeout, unit); + } +diff --git a/guava/src/com/google/common/util/concurrent/ForwardingBlockingQueue.java b/guava/src/com/google/common/util/concurrent/ForwardingBlockingQueue.java +index dc8511d94c..676b874e1a 100644 +--- a/guava/src/com/google/common/util/concurrent/ForwardingBlockingQueue.java ++++ b/guava/src/com/google/common/util/concurrent/ForwardingBlockingQueue.java +@@ -63,8 +63,8 @@ public abstract class ForwardingBlockingQueue extends ForwardingQueue + return delegate().offer(e, timeout, unit); + } + +- @Override + @CheckForNull ++ @Override + public E poll(long timeout, TimeUnit unit) throws InterruptedException { + return delegate().poll(timeout, unit); + } +diff --git a/guava/src/com/google/common/util/concurrent/ForwardingFuture.java b/guava/src/com/google/common/util/concurrent/ForwardingFuture.java +index 47002b03a3..fc08ae9328 100644 +--- a/guava/src/com/google/common/util/concurrent/ForwardingFuture.java ++++ b/guava/src/com/google/common/util/concurrent/ForwardingFuture.java +@@ -14,8 +14,9 @@ + + package com.google.common.util.concurrent; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import com.google.common.collect.ForwardingObject; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.concurrent.ExecutionException; +@@ -85,7 +86,7 @@ public abstract class ForwardingFuture extends Forwa + private final Future delegate; + + protected SimpleForwardingFuture(Future delegate) { +- this.delegate = Preconditions.checkNotNull(delegate); ++ this.delegate = checkNotNull(delegate); + } + + @Override +diff --git a/guava/src/com/google/common/util/concurrent/ForwardingListenableFuture.java b/guava/src/com/google/common/util/concurrent/ForwardingListenableFuture.java +index 386809194b..83c001bc9e 100644 +--- a/guava/src/com/google/common/util/concurrent/ForwardingListenableFuture.java ++++ b/guava/src/com/google/common/util/concurrent/ForwardingListenableFuture.java +@@ -14,8 +14,9 @@ + + package com.google.common.util.concurrent; + ++import static com.google.common.base.Preconditions.checkNotNull; ++ + import com.google.common.annotations.GwtCompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.util.concurrent.Executor; + import org.checkerframework.checker.nullness.qual.Nullable; +@@ -59,7 +60,7 @@ public abstract class ForwardingListenableFuture + private final ListenableFuture delegate; + + protected SimpleForwardingListenableFuture(ListenableFuture delegate) { +- this.delegate = Preconditions.checkNotNull(delegate); ++ this.delegate = checkNotNull(delegate); + } + + @Override +diff --git a/guava/src/com/google/common/util/concurrent/Futures.java b/guava/src/com/google/common/util/concurrent/Futures.java +index 09b5c3c1a4..8c3c053610 100644 +--- a/guava/src/com/google/common/util/concurrent/Futures.java ++++ b/guava/src/com/google/common/util/concurrent/Futures.java +@@ -26,7 +26,6 @@ import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.base.Function; + import com.google.common.base.MoreObjects; +-import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableList; + import com.google.common.util.concurrent.CollectionFuture.ListFuture; + import com.google.common.util.concurrent.ImmediateFuture.ImmediateCancelledFuture; +@@ -759,8 +758,8 @@ public final class Futures extends GwtFuturesCatchingSpecialization { + public ListenableFuture run(final Runnable combiner, Executor executor) { + return call( + new Callable<@Nullable Void>() { +- @Override + @CheckForNull ++ @Override + public Void call() throws Exception { + combiner.run(); + return null; +@@ -806,8 +805,8 @@ public final class Futures extends GwtFuturesCatchingSpecialization { + } + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + ListenableFuture localDelegate = delegate; + if (localDelegate != null) { +@@ -979,8 +978,8 @@ public final class Futures extends GwtFuturesCatchingSpecialization { + state = null; + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + InCompletionOrderState localState = state; + if (localState != null) { +@@ -1101,7 +1100,7 @@ public final class Futures extends GwtFuturesCatchingSpecialization { + final ListenableFuture future, + final FutureCallback callback, + Executor executor) { +- Preconditions.checkNotNull(callback); ++ checkNotNull(callback); + future.addListener(new CallbackListener(future, callback), executor); + } + +@@ -1330,8 +1329,8 @@ public final class Futures extends GwtFuturesCatchingSpecialization { + @Beta + @CanIgnoreReturnValue + @GwtIncompatible // reflection +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @ParametricNullness ++ @ParametricNullness // should accept a java.time.Duration ++ @SuppressWarnings("GoodTime") + public static V getChecked( + Future future, Class exceptionClass, long timeout, TimeUnit unit) throws X { + return FuturesGetChecked.getChecked(future, exceptionClass, timeout, unit); +diff --git a/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java b/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java +index 6f09b8066d..bc3470ea78 100644 +--- a/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java ++++ b/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java +@@ -51,8 +51,8 @@ final class FuturesGetChecked { + + /** Implementation of {@link Futures#getChecked(Future, Class)}. */ + @CanIgnoreReturnValue +- @VisibleForTesting + @ParametricNullness ++ @VisibleForTesting + static V getChecked( + GetCheckedTypeValidator validator, Future future, Class exceptionClass) throws X { + validator.validateClass(exceptionClass); +@@ -228,7 +228,7 @@ final class FuturesGetChecked { + + private static X newWithCause(Class exceptionClass, Throwable cause) { + // getConstructors() guarantees this as long as we don't modify the array. +- @SuppressWarnings({"unchecked", "rawtypes"}) ++ @SuppressWarnings({"rawtypes", "unchecked"}) + List> constructors = (List) Arrays.asList(exceptionClass.getConstructors()); + for (Constructor constructor : preferringStrings(constructors)) { + X instance = newFromConstructor(constructor, cause); +diff --git a/guava/src/com/google/common/util/concurrent/InterruptibleTask.java b/guava/src/com/google/common/util/concurrent/InterruptibleTask.java +index bcec007303..6fbf846bcd 100644 +--- a/guava/src/com/google/common/util/concurrent/InterruptibleTask.java ++++ b/guava/src/com/google/common/util/concurrent/InterruptibleTask.java +@@ -25,7 +25,7 @@ import java.util.concurrent.locks.LockSupport; + import org.checkerframework.checker.nullness.qual.Nullable; + + @GwtCompatible(emulated = true) +-@ReflectionSupport(value = ReflectionSupport.Level.FULL) ++@ReflectionSupport(ReflectionSupport.Level.FULL) + @ElementTypesAreNonnullByDefault + // Some Android 5.0.x Samsung devices have bugs in JDK reflection APIs that cause + // getDeclaredField to throw a NoSuchFieldException when the field is definitely there. +@@ -52,8 +52,8 @@ abstract class InterruptibleTask + // Why 1000? WHY NOT! + private static final int MAX_BUSY_WAIT_SPINS = 1000; + +- @SuppressWarnings("ThreadPriorityCheck") // The cow told me to +- @Override ++ @Override // The cow told me to ++ @SuppressWarnings("ThreadPriorityCheck") + public final void run() { + /* + * Set runner thread before checking isDone(). If we were to check isDone() first, the task +diff --git a/guava/src/com/google/common/util/concurrent/ListenerCallQueue.java b/guava/src/com/google/common/util/concurrent/ListenerCallQueue.java +index ed8c9065ac..ef7bcd1977 100644 +--- a/guava/src/com/google/common/util/concurrent/ListenerCallQueue.java ++++ b/guava/src/com/google/common/util/concurrent/ListenerCallQueue.java +@@ -15,13 +15,13 @@ + package com.google.common.util.concurrent; + + import static com.google.common.base.Preconditions.checkNotNull; ++import static com.google.common.base.Preconditions.checkState; ++import static java.util.Collections.synchronizedList; + + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.common.collect.Queues; + import com.google.errorprone.annotations.concurrent.GuardedBy; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Queue; + import java.util.concurrent.Executor; +@@ -60,7 +60,7 @@ final class ListenerCallQueue { + + // TODO(chrisn): promote AppendOnlyCollection for use here. + private final List> listeners = +- Collections.synchronizedList(new ArrayList>()); ++ synchronizedList(new ArrayList>()); + + /** Method reference-compatible listener event. */ + interface Event { +@@ -191,7 +191,7 @@ final class ListenerCallQueue { + ListenerCallQueue.Event nextToRun; + Object nextLabel; + synchronized (PerListenerQueue.this) { +- Preconditions.checkState(isThreadScheduled); ++ checkState(isThreadScheduled); + nextToRun = waitQueue.poll(); + nextLabel = labelQueue.poll(); + if (nextToRun == null) { +diff --git a/guava/src/com/google/common/util/concurrent/MoreExecutors.java b/guava/src/com/google/common/util/concurrent/MoreExecutors.java +index 90776bc9e6..d5d46ab499 100644 +--- a/guava/src/com/google/common/util/concurrent/MoreExecutors.java ++++ b/guava/src/com/google/common/util/concurrent/MoreExecutors.java +@@ -17,6 +17,7 @@ package com.google.common.util.concurrent; + import static com.google.common.base.Preconditions.checkArgument; + import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.util.concurrent.Internal.toNanosSaturated; ++import static java.util.Collections.emptyList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtCompatible; +@@ -32,7 +33,6 @@ import com.google.errorprone.annotations.concurrent.GuardedBy; + import java.lang.reflect.InvocationTargetException; + import java.time.Duration; + import java.util.Collection; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; + import java.util.concurrent.BlockingQueue; +@@ -347,7 +347,7 @@ public final class MoreExecutors { + @Override + public List shutdownNow() { + shutdown(); +- return Collections.emptyList(); ++ return emptyList(); + } + + @Override +@@ -772,9 +772,9 @@ public final class MoreExecutors { + * An implementation of {@link ExecutorService#invokeAny} for {@link ListeningExecutorService} + * implementations. + */ +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @GwtIncompatible ++ @GwtIncompatible // should accept a java.time.Duration + @ParametricNullness ++ @SuppressWarnings("GoodTime") + static T invokeAnyImpl( + ListeningExecutorService executorService, + Collection> tasks, +diff --git a/guava/src/com/google/common/util/concurrent/NullnessCasts.java b/guava/src/com/google/common/util/concurrent/NullnessCasts.java +index a3a914e897..a72f7a1459 100644 +--- a/guava/src/com/google/common/util/concurrent/NullnessCasts.java ++++ b/guava/src/com/google/common/util/concurrent/NullnessCasts.java +@@ -50,8 +50,8 @@ final class NullnessCasts { + * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its + * value may be legitimately {@code null}.) + */ +- @SuppressWarnings("nullness") + @ParametricNullness ++ @SuppressWarnings("nullness") + static T uncheckedCastNullableTToT(@CheckForNull T t) { + return t; + } +@@ -65,9 +65,9 @@ final class NullnessCasts { + * return to a caller, the code needs to a way to return {@code null} from a method that returns + * "plain {@code T}." This API provides that. + */ +- @SuppressWarnings({"nullness", "TypeParameterUnusedInFormals", "ReturnMissingNullable"}) +- // The warnings are legitimate. Each time we use this method, we document why. + @ParametricNullness ++ // The warnings are legitimate. Each time we use this method, we document why. ++ @SuppressWarnings({"nullness", "ReturnMissingNullable", "TypeParameterUnusedInFormals"}) + static T uncheckedNull() { + return null; + } +diff --git a/guava/src/com/google/common/util/concurrent/SequentialExecutor.java b/guava/src/com/google/common/util/concurrent/SequentialExecutor.java +index d0b600be84..84e43f4ea6 100644 +--- a/guava/src/com/google/common/util/concurrent/SequentialExecutor.java ++++ b/guava/src/com/google/common/util/concurrent/SequentialExecutor.java +@@ -22,7 +22,6 @@ import static com.google.common.util.concurrent.SequentialExecutor.WorkerRunning + import static java.lang.System.identityHashCode; + + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.concurrent.GuardedBy; + import com.google.j2objc.annotations.RetainedWith; + import java.util.ArrayDeque; +@@ -86,7 +85,7 @@ final class SequentialExecutor implements Executor { + + /** Use {@link MoreExecutors#newSequentialExecutor} */ + SequentialExecutor(Executor executor) { +- this.executor = Preconditions.checkNotNull(executor); ++ this.executor = checkNotNull(executor); + } + + /** +@@ -249,8 +248,8 @@ final class SequentialExecutor implements Executor { + } + } + +- @SuppressWarnings("GuardedBy") + @Override ++ @SuppressWarnings("GuardedBy") + public String toString() { + Runnable currentlyRunning = task; + if (currentlyRunning != null) { +diff --git a/guava/src/com/google/common/util/concurrent/ServiceManager.java b/guava/src/com/google/common/util/concurrent/ServiceManager.java +index 5ab95ffa6b..69206920a0 100644 +--- a/guava/src/com/google/common/util/concurrent/ServiceManager.java ++++ b/guava/src/com/google/common/util/concurrent/ServiceManager.java +@@ -485,8 +485,8 @@ public final class ServiceManager implements ServiceManagerBridge { + super(ServiceManagerState.this.monitor); + } + +- @Override + @GuardedBy("ServiceManagerState.this.monitor") ++ @Override + public boolean isSatisfied() { + // All services have started or some service has terminated/failed. + return states.count(RUNNING) == numberOfServices +@@ -505,8 +505,8 @@ public final class ServiceManager implements ServiceManagerBridge { + super(ServiceManagerState.this.monitor); + } + +- @Override + @GuardedBy("ServiceManagerState.this.monitor") ++ @Override + public boolean isSatisfied() { + return states.count(TERMINATED) + states.count(FAILED) == numberOfServices; + } +diff --git a/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java b/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java +index c6ade6a3a0..e96903a0cd 100644 +--- a/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java ++++ b/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java +@@ -84,8 +84,8 @@ public final class SimpleTimeLimiter implements TimeLimiter { + + InvocationHandler handler = + new InvocationHandler() { +- @Override + @CheckForNull ++ @Override + public Object invoke(Object obj, Method method, @CheckForNull @Nullable Object[] args) + throws Throwable { + Callable<@Nullable Object> callable = +diff --git a/guava/src/com/google/common/util/concurrent/Striped.java b/guava/src/com/google/common/util/concurrent/Striped.java +index 2ea61cb324..f356c07060 100644 +--- a/guava/src/com/google/common/util/concurrent/Striped.java ++++ b/guava/src/com/google/common/util/concurrent/Striped.java +@@ -14,13 +14,15 @@ + + package com.google.common.util.concurrent; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.base.Preconditions.checkElementIndex; + import static com.google.common.collect.Lists.newArrayList; ++import static java.util.Collections.unmodifiableList; + + import com.google.common.annotations.Beta; + import com.google.common.annotations.GwtIncompatible; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.base.MoreObjects; +-import com.google.common.base.Preconditions; + import com.google.common.base.Supplier; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.MapMaker; +@@ -31,7 +33,6 @@ import java.lang.ref.ReferenceQueue; + import java.lang.ref.WeakReference; + import java.math.RoundingMode; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.Semaphore; +@@ -181,7 +182,7 @@ public abstract class Striped { + */ + @SuppressWarnings("unchecked") // we carefully replaced all keys with their respective L's + List asStripes = (List) result; +- return Collections.unmodifiableList(asStripes); ++ return unmodifiableList(asStripes); + } + + // Static factories +@@ -340,7 +341,7 @@ public abstract class Striped { + final int mask; + + PowerOfTwoStriped(int stripes) { +- Preconditions.checkArgument(stripes > 0, "Stripes must be positive"); ++ checkArgument(stripes > 0, "Stripes must be positive"); + this.mask = stripes > Ints.MAX_POWER_OF_TWO ? ALL_SET : ceilToPowerOfTwo(stripes) - 1; + } + +@@ -366,7 +367,7 @@ public abstract class Striped { + + private CompactStriped(int stripes, Supplier supplier) { + super(stripes); +- Preconditions.checkArgument(stripes <= Ints.MAX_POWER_OF_TWO, "Stripes must be <= 2^30)"); ++ checkArgument(stripes <= Ints.MAX_POWER_OF_TWO, "Stripes must be <= 2^30)"); + + this.array = new Object[mask + 1]; + for (int i = 0; i < array.length; i++) { +@@ -374,8 +375,8 @@ public abstract class Striped { + } + } + +- @SuppressWarnings("unchecked") // we only put L's in the array +- @Override ++ @Override // we only put L's in the array ++ @SuppressWarnings("unchecked") + public L getAt(int index) { + return (L) array[index]; + } +@@ -408,7 +409,7 @@ public abstract class Striped { + @Override + public L getAt(int index) { + if (size != Integer.MAX_VALUE) { +- Preconditions.checkElementIndex(index, size()); ++ checkElementIndex(index, size()); + } // else no check necessary, all index values are valid + ArrayReference existingRef = locks.get(index); + L existing = existingRef == null ? null : existingRef.get(); +@@ -479,7 +480,7 @@ public abstract class Striped { + @Override + public L getAt(int index) { + if (size != Integer.MAX_VALUE) { +- Preconditions.checkElementIndex(index, size()); ++ checkElementIndex(index, size()); + } // else no check necessary, all index values are valid + L existing = locks.get(index); + if (existing != null) { +diff --git a/guava/src/com/google/common/util/concurrent/TimeLimiter.java b/guava/src/com/google/common/util/concurrent/TimeLimiter.java +index 0245fec3ca..c743db35c4 100644 +--- a/guava/src/com/google/common/util/concurrent/TimeLimiter.java ++++ b/guava/src/com/google/common/util/concurrent/TimeLimiter.java +@@ -144,8 +144,8 @@ public interface TimeLimiter { + * @throws ExecutionError if {@code callable} throws an {@code Error} + * @since 22.0 + */ +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @CanIgnoreReturnValue ++ @CanIgnoreReturnValue // should accept a java.time.Duration ++ @SuppressWarnings("GoodTime") + T callWithTimeout( + Callable callable, long timeoutDuration, TimeUnit timeoutUnit) + throws TimeoutException, InterruptedException, ExecutionException; +@@ -191,8 +191,8 @@ public interface TimeLimiter { + * @throws ExecutionError if {@code callable} throws an {@code Error} + * @since 22.0 + */ +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @CanIgnoreReturnValue ++ @CanIgnoreReturnValue // should accept a java.time.Duration ++ @SuppressWarnings("GoodTime") + T callUninterruptiblyWithTimeout( + Callable callable, long timeoutDuration, TimeUnit timeoutUnit) + throws TimeoutException, ExecutionException; +diff --git a/guava/src/com/google/common/util/concurrent/TimeoutFuture.java b/guava/src/com/google/common/util/concurrent/TimeoutFuture.java +index ed8a7bfdbe..7cb535b872 100644 +--- a/guava/src/com/google/common/util/concurrent/TimeoutFuture.java ++++ b/guava/src/com/google/common/util/concurrent/TimeoutFuture.java +@@ -14,10 +14,10 @@ + + package com.google.common.util.concurrent; + ++import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.util.concurrent.MoreExecutors.directExecutor; + + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import java.util.concurrent.ExecutionException; + import java.util.concurrent.Future; + import java.util.concurrent.ScheduledExecutorService; +@@ -77,7 +77,7 @@ final class TimeoutFuture extends FluentFuture.Trust + @CheckForNull private ScheduledFuture timer; + + private TimeoutFuture(ListenableFuture delegate) { +- this.delegateRef = Preconditions.checkNotNull(delegate); ++ this.delegateRef = checkNotNull(delegate); + } + + /** A runnable that is called when the delegate or the timer completes. */ +@@ -153,8 +153,8 @@ final class TimeoutFuture extends FluentFuture.Trust + } + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + ListenableFuture localInputFuture = delegateRef; + ScheduledFuture localTimer = timer; +diff --git a/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java b/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java +index 929c9fb1ea..e25d67c32b 100644 +--- a/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java ++++ b/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java +@@ -102,8 +102,8 @@ class TrustedListenableFutureTask extends FluentFutu + this.task = null; + } + +- @Override + @CheckForNull ++ @Override + protected String pendingToString() { + InterruptibleTask localTask = task; + if (localTask != null) { +diff --git a/guava/src/com/google/common/util/concurrent/Uninterruptibles.java b/guava/src/com/google/common/util/concurrent/Uninterruptibles.java +index 09ace92fae..1c34bb2c92 100644 +--- a/guava/src/com/google/common/util/concurrent/Uninterruptibles.java ++++ b/guava/src/com/google/common/util/concurrent/Uninterruptibles.java +@@ -14,13 +14,13 @@ + + package com.google.common.util.concurrent; + ++import static com.google.common.base.Preconditions.checkNotNull; + import static com.google.common.base.Verify.verify; + import static com.google.common.util.concurrent.Internal.toNanosSaturated; + import static java.util.concurrent.TimeUnit.NANOSECONDS; + + import com.google.common.annotations.GwtCompatible; + import com.google.common.annotations.GwtIncompatible; +-import com.google.common.base.Preconditions; + import com.google.errorprone.annotations.CanIgnoreReturnValue; + import java.time.Duration; + import java.util.concurrent.BlockingQueue; +@@ -190,7 +190,7 @@ public final class Uninterruptibles { + @GwtIncompatible // concurrency + @SuppressWarnings("GoodTime") // should accept a java.time.Duration + public static void joinUninterruptibly(Thread toJoin, long timeout, TimeUnit unit) { +- Preconditions.checkNotNull(toJoin); ++ checkNotNull(toJoin); + boolean interrupted = false; + try { + long remainingNanos = unit.toNanos(timeout); +@@ -296,8 +296,8 @@ public final class Uninterruptibles { + */ + @CanIgnoreReturnValue + @GwtIncompatible // TODO +- @SuppressWarnings("GoodTime") // should accept a java.time.Duration +- @ParametricNullness ++ @ParametricNullness // should accept a java.time.Duration ++ @SuppressWarnings("GoodTime") + public static V getUninterruptibly( + Future future, long timeout, TimeUnit unit) throws ExecutionException, TimeoutException { + boolean interrupted = false; diff --git a/integration-tests/guava-v31.1-init.patch b/integration-tests/guava-v31.1-init.patch index 9f4bcac8..51ee92df 100644 --- a/integration-tests/guava-v31.1-init.patch +++ b/integration-tests/guava-v31.1-init.patch @@ -1,5 +1,81 @@ +diff --git a/guava/src/com/google/common/base/Strings.java b/guava/src/com/google/common/base/Strings.java +index e56bf1c481..459acbca1a 100644 +--- a/guava/src/com/google/common/base/Strings.java ++++ b/guava/src/com/google/common/base/Strings.java +@@ -265,6 +265,7 @@ public final class Strings { + * @since 25.1 + */ + // TODO(diamondm) consider using Arrays.toString() for array parameters ++ @SuppressWarnings("IdentityConversion") + public static String lenientFormat( + @CheckForNull String template, @CheckForNull @Nullable Object... args) { + template = String.valueOf(template); // null -> "null" +diff --git a/guava/src/com/google/common/graph/UndirectedNetworkConnections.java b/guava/src/com/google/common/graph/UndirectedNetworkConnections.java +index 190897f882..f11f98867c 100644 +--- a/guava/src/com/google/common/graph/UndirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/UndirectedNetworkConnections.java +@@ -43,6 +43,7 @@ final class UndirectedNetworkConnections extends AbstractUndirectedNetwork + return new UndirectedNetworkConnections<>(HashBiMap.create(EXPECTED_DEGREE)); + } + ++ @SuppressWarnings("IdentityConversion") + static UndirectedNetworkConnections ofImmutable(Map incidentEdges) { + return new UndirectedNetworkConnections<>(ImmutableBiMap.copyOf(incidentEdges)); + } +diff --git a/guava/src/com/google/common/graph/DirectedNetworkConnections.java b/guava/src/com/google/common/graph/DirectedNetworkConnections.java +index e1db65708e..9d70c790ee 100644 +--- a/guava/src/com/google/common/graph/DirectedNetworkConnections.java ++++ b/guava/src/com/google/common/graph/DirectedNetworkConnections.java +@@ -44,6 +44,7 @@ final class DirectedNetworkConnections extends AbstractDirectedNetworkConn + HashBiMap.create(EXPECTED_DEGREE), HashBiMap.create(EXPECTED_DEGREE), 0); + } + ++ @SuppressWarnings("IdentityConversion") + static DirectedNetworkConnections ofImmutable( + Map inEdges, Map outEdges, int selfLoopCount) { + return new DirectedNetworkConnections<>( +diff --git a/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java b/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java +index 35063e815d..3f445ca116 100644 +--- a/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java ++++ b/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java +@@ -60,6 +60,7 @@ public class MapGenerators { + + public static class ImmutableMapCopyOfGenerator extends TestStringMapGenerator { + @Override ++ @SuppressWarnings("IdentityConversion") + protected Map create(Entry[] entries) { + Map builder = Maps.newLinkedHashMap(); + for (Entry entry : entries) { +@@ -71,6 +72,7 @@ public class MapGenerators { + + public static class ImmutableMapCopyOfEntriesGenerator extends TestStringMapGenerator { + @Override ++ @SuppressWarnings("IdentityConversion") + protected Map create(Entry[] entries) { + return ImmutableMap.copyOf(Arrays.asList(entries)); + } +@@ -162,6 +164,7 @@ public class MapGenerators { + + public static class ImmutableMapCopyOfEnumMapGenerator extends TestEnumMapGenerator { + @Override ++ @SuppressWarnings("IdentityConversion") + protected Map create(Entry[] entries) { + EnumMap map = new EnumMap<>(AnEnum.class); + for (Entry entry : entries) { +diff --git a/guava/src/com/google/common/collect/RegularImmutableSortedSet.java b/guava/src/com/google/common/collect/RegularImmutableSortedSet.java +index 572e0acbf5..fa17e67916 100644 +--- a/guava/src/com/google/common/collect/RegularImmutableSortedSet.java ++++ b/guava/src/com/google/common/collect/RegularImmutableSortedSet.java +@@ -324,6 +324,7 @@ final class RegularImmutableSortedSet extends ImmutableSortedSet { + + @Override + ImmutableSortedSet createDescendingSet() { ++ @SuppressWarnings("StaticImport") + Comparator reversedOrder = Collections.reverseOrder(comparator); + return isEmpty() + ? emptySet(reversedOrder) diff --git a/pom.xml b/pom.xml -index 13dd0985d3..b50449f60d 100644 +index 13dd0985d3..3fa0827e02 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,9 @@ @@ -12,54 +88,11 @@ index 13dd0985d3..b50449f60d 100644 GitHub Issues -@@ -347,50 +350,100 @@ +@@ -346,6 +349,56 @@ + - -- sonatype-oss-release -- -- -- -- org.apache.maven.plugins -- maven-source-plugin -- ${maven-source-plugin.version} -- -- -- attach-sources -- -- jar-no-fork -- -- -- -- -- -- org.apache.maven.plugins -- maven-javadoc-plugin -- ${maven-javadoc-plugin.version} -- -- -- attach-javadocs -- -- jar -- -- -- -- -- -- org.apache.maven.plugins -- maven-gpg-plugin -- 1.6 -- -- -- sign-artifacts -- verify -- -- sign -- -- -- -- -- ++ + error-prone-compile + + @@ -82,7 +115,7 @@ index 13dd0985d3..b50449f60d 100644 + -Xpkginfo:always + -XDcompilePolicy=simple + -+ -Xplugin:ErrorProne ${error-prone.flags} -Xep:CollectorMutability:OFF -Xep:FluxImplicitBlock:OFF -Xep:ScheduledTransactionTrace:OFF ++ -Xplugin:ErrorProne ${error-prone.flags} -Xep:CollectorMutability:OFF -Xep:FluxImplicitBlock:OFF -Xep:ScheduledTransactionTrace:OFF -XepOpt:Refaster:NamePattern=^(?!Immutable).* + + + @@ -109,51 +142,6 @@ index 13dd0985d3..b50449f60d 100644 + + + -+ -+ sonatype-oss-release -+ -+ -+ -+ org.apache.maven.plugins -+ maven-source-plugin -+ ${maven-source-plugin.version} -+ -+ -+ attach-sources -+ -+ jar-no-fork -+ -+ -+ -+ -+ -+ org.apache.maven.plugins -+ maven-javadoc-plugin -+ ${maven-javadoc-plugin.version} -+ -+ -+ attach-javadocs -+ -+ jar -+ -+ -+ -+ -+ -+ org.apache.maven.plugins -+ maven-gpg-plugin -+ 1.6 -+ -+ -+ sign-artifacts -+ verify -+ -+ sign -+ -+ -+ -+ -+ - - + sonatype-oss-release +