The following issues were found
android/guava-tests/test/com/google/common/collect/ForwardingSortedMapTest.java
8 issues
Line: 46
* @author Robert KonigsbergSortedMapFeature
*/
public class ForwardingSortedMapTest extends TestCase {
static class StandardImplForwardingSortedMap<K, V> extends ForwardingSortedMap<K, V> {
private final SortedMap<K, V> backingSortedMap;
StandardImplForwardingSortedMap(SortedMap<K, V> backingSortedMap) {
this.backingSortedMap = backingSortedMap;
}
Reported by PMD.
Line: 47
*/
public class ForwardingSortedMapTest extends TestCase {
static class StandardImplForwardingSortedMap<K, V> extends ForwardingSortedMap<K, V> {
private final SortedMap<K, V> backingSortedMap;
StandardImplForwardingSortedMap(SortedMap<K, V> backingSortedMap) {
this.backingSortedMap = backingSortedMap;
}
Reported by PMD.
Line: 108
return new StandardEntrySet() {
@Override
public Iterator<Entry<K, V>> iterator() {
return backingSortedMap.entrySet().iterator();
}
};
}
@Override
Reported by PMD.
Line: 129
}
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ForwardingSortedMapTest.class);
suite.addTest(
SortedMapTestSuiteBuilder.using(
Reported by PMD.
Line: 204
return suite;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
SortedMap.class,
new Function<SortedMap, SortedMap>() {
Reported by PMD.
Line: 205
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void testForwarding() {
new ForwardingWrapperTester()
.testForwarding(
SortedMap.class,
new Function<SortedMap, SortedMap>() {
@Override
Reported by PMD.
Line: 217
});
}
public void testEquals() {
SortedMap<Integer, String> map1 = ImmutableSortedMap.of(1, "one");
SortedMap<Integer, String> map2 = ImmutableSortedMap.of(2, "two");
new EqualsTester()
.addEqualityGroup(map1, wrap(map1), wrap(map1))
.addEqualityGroup(map2, wrap(map2))
Reported by PMD.
Line: 217
});
}
public void testEquals() {
SortedMap<Integer, String> map1 = ImmutableSortedMap.of(1, "one");
SortedMap<Integer, String> map2 = ImmutableSortedMap.of(2, "two");
new EqualsTester()
.addEqualityGroup(map1, wrap(map1), wrap(map1))
.addEqualityGroup(map2, wrap(map2))
Reported by PMD.
android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java
8 issues
Line: 35
* @author Sverre Sundsdal
*/
public class MinMaxPriorityQueueBenchmark {
@Param private ComparatorType comparator;
// TODO(kevinb): add 1000000 back when we have the ability to throw
// NotApplicableException in the expensive comparator case.
@Param({"100", "10000"})
private int size;
Reported by PMD.
Line: 40
// TODO(kevinb): add 1000000 back when we have the ability to throw
// NotApplicableException in the expensive comparator case.
@Param({"100", "10000"})
private int size;
@Param private HeapType heap;
private Queue<Integer> queue;
Reported by PMD.
Line: 42
@Param({"100", "10000"})
private int size;
@Param private HeapType heap;
private Queue<Integer> queue;
private final Random random = new Random();
Reported by PMD.
Line: 44
@Param private HeapType heap;
private Queue<Integer> queue;
private final Random random = new Random();
@BeforeExperiment
void setUp() {
Reported by PMD.
Line: 46
private Queue<Integer> queue;
private final Random random = new Random();
@BeforeExperiment
void setUp() {
queue = heap.create(comparator.get());
for (int i = 0; i < size; i++) {
Reported by PMD.
Line: 48
private final Random random = new Random();
@BeforeExperiment
void setUp() {
queue = heap.create(comparator.get());
for (int i = 0; i < size; i++) {
queue.add(random.nextInt());
}
Reported by PMD.
Line: 81
* pollMax using the same code that benchmarks poll.
*/
static final class InvertedMinMaxPriorityQueue<T> extends ForwardingQueue<T> {
MinMaxPriorityQueue<T> mmHeap;
public InvertedMinMaxPriorityQueue(Comparator<T> comparator) {
mmHeap = MinMaxPriorityQueue.orderedBy(comparator).create();
}
Reported by PMD.
Line: 102
MIN_MAX {
@Override
public Queue<Integer> create(Comparator<Integer> comparator) {
return MinMaxPriorityQueue.orderedBy(comparator).create();
}
},
PRIORITY_QUEUE {
@Override
public Queue<Integer> create(Comparator<Integer> comparator) {
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapTestSuiteBuilder.java
8 issues
Line: 58
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(ListMultimapAsMapTester.class);
testers.add(ListMultimapEqualsTester.class);
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
Reported by PMD.
Line: 59
protected List<Class<? extends AbstractTester>> getTesters() {
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(ListMultimapAsMapTester.class);
testers.add(ListMultimapEqualsTester.class);
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
return testers;
Reported by PMD.
Line: 60
List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());
testers.add(ListMultimapAsMapTester.class);
testers.add(ListMultimapEqualsTester.class);
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
return testers;
}
Reported by PMD.
Line: 61
testers.add(ListMultimapAsMapTester.class);
testers.add(ListMultimapEqualsTester.class);
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
return testers;
}
Reported by PMD.
Line: 62
testers.add(ListMultimapEqualsTester.class);
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
return testers;
}
@Override
Reported by PMD.
Line: 63
testers.add(ListMultimapPutTester.class);
testers.add(ListMultimapPutAllTester.class);
testers.add(ListMultimapRemoveTester.class);
testers.add(ListMultimapReplaceValuesTester.class);
return testers;
}
@Override
TestSuite computeMultimapGetTestSuite(
Reported by PMD.
Line: 101
@Override
Set<Feature<?>> computeMultimapGetFeatures(Set<Feature<?>> multimapFeatures) {
Set<Feature<?>> derivedFeatures = super.computeMultimapGetFeatures(multimapFeatures);
if (derivedFeatures.contains(CollectionFeature.SUPPORTS_ADD)) {
derivedFeatures.add(ListFeature.SUPPORTS_ADD_WITH_INDEX);
}
if (derivedFeatures.contains(CollectionFeature.GENERAL_PURPOSE)) {
derivedFeatures.add(ListFeature.GENERAL_PURPOSE);
}
Reported by PMD.
Line: 104
if (derivedFeatures.contains(CollectionFeature.SUPPORTS_ADD)) {
derivedFeatures.add(ListFeature.SUPPORTS_ADD_WITH_INDEX);
}
if (derivedFeatures.contains(CollectionFeature.GENERAL_PURPOSE)) {
derivedFeatures.add(ListFeature.GENERAL_PURPOSE);
}
return derivedFeatures;
}
Reported by PMD.
android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
8 issues
Line: 40
private static final int[] binomials = new int[ARRAY_SIZE];
@Param({"50", "1000", "10000"})
int factorialBound;
@BeforeExperiment
void setUp() {
for (int i = 0; i < ARRAY_SIZE; i++) {
factorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
Reported by PMD.
Line: 42
@Param({"50", "1000", "10000"})
int factorialBound;
@BeforeExperiment
void setUp() {
for (int i = 0; i < ARRAY_SIZE; i++) {
factorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1);
Reported by PMD.
Line: 53
/** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
private static BigInteger oldSlowFactorial(int n) {
if (n <= 20) {
return BigInteger.valueOf(LongMath.factorial(n));
} else {
int k = 20;
return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n));
}
Reported by PMD.
Line: 57
return BigInteger.valueOf(LongMath.factorial(n));
} else {
int k = 20;
return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n));
}
}
/** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
private static BigInteger oldSlowFactorial(int n1, int n2) {
Reported by PMD.
Line: 78
* Currently, we just divide the range in half.
*/
int mid = (n1 + n2) >>> 1;
return oldSlowFactorial(n1, mid).multiply(oldSlowFactorial(mid, n2));
}
@Benchmark
int slowFactorial(int reps) {
int tmp = 0;
Reported by PMD.
Line: 86
int tmp = 0;
for (int i = 0; i < reps; i++) {
int j = i & ARRAY_MASK;
tmp += oldSlowFactorial(slowFactorials[j]).intValue();
}
return tmp;
}
@Benchmark
Reported by PMD.
Line: 96
int tmp = 0;
for (int i = 0; i < reps; i++) {
int j = i & ARRAY_MASK;
tmp += BigIntegerMath.factorial(factorials[j]).intValue();
}
return tmp;
}
@Benchmark
Reported by PMD.
Line: 106
int tmp = 0;
for (int i = 0; i < reps; i++) {
int j = i & 0xffff;
tmp += BigIntegerMath.binomial(factorials[j], binomials[j]).intValue();
}
return tmp;
}
}
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/google/SortedMapGenerators.java
8 issues
Line: 90
return new Ordering<Entry<String, Integer>>() {
@Override
public int compare(Entry<String, Integer> left, Entry<String, Integer> right) {
return left.getKey().compareTo(right.getKey());
}
}.sortedCopy(insertionOrder);
}
@Override
Reported by PMD.
Line: 103
Entry<String, Integer> entry = (Entry<String, Integer>) o;
builder.put(entry);
}
return builder.build().entrySet().asList();
}
}
public static class ImmutableSortedMapKeyListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 103
Entry<String, Integer> entry = (Entry<String, Integer>) o;
builder.put(entry);
}
return builder.build().entrySet().asList();
}
}
public static class ImmutableSortedMapKeyListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 114
for (int i = 0; i < elements.length; i++) {
builder.put(elements[i], i);
}
return builder.build().keySet().asList();
}
@Override
public List<String> order(List<String> insertionOrder) {
return Ordering.natural().sortedCopy(insertionOrder);
Reported by PMD.
Line: 114
for (int i = 0; i < elements.length; i++) {
builder.put(elements[i], i);
}
return builder.build().keySet().asList();
}
@Override
public List<String> order(List<String> insertionOrder) {
return Ordering.natural().sortedCopy(insertionOrder);
Reported by PMD.
Line: 119
@Override
public List<String> order(List<String> insertionOrder) {
return Ordering.natural().sortedCopy(insertionOrder);
}
}
public static class ImmutableSortedMapValueListGenerator extends TestStringListGenerator {
@Override
Reported by PMD.
Line: 130
for (int i = 0; i < elements.length; i++) {
builder.put(i, elements[i]);
}
return builder.build().values().asList();
}
}
}
Reported by PMD.
Line: 130
for (int i = 0; i < elements.length; i++) {
builder.put(i, elements[i]);
}
return builder.build().values().asList();
}
}
}
Reported by PMD.
android/guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java
8 issues
Line: 34
static final int SAMPLE_MASK = 0x0FFF;
@Param("1234")
int randomSeed;
int[] xInts;
int[] yInts;
long[] xLongs;
Reported by PMD.
Line: 36
@Param("1234")
int randomSeed;
int[] xInts;
int[] yInts;
long[] xLongs;
long[] yLongs;
Reported by PMD.
Line: 37
int randomSeed;
int[] xInts;
int[] yInts;
long[] xLongs;
long[] yLongs;
int[] constant;
Reported by PMD.
Line: 39
int[] xInts;
int[] yInts;
long[] xLongs;
long[] yLongs;
int[] constant;
private static final long NONNEGATIVE_LONG_MASK = 0x7FFFFFFFFFFFFFFFL;
Reported by PMD.
Line: 40
int[] yInts;
long[] xLongs;
long[] yLongs;
int[] constant;
private static final long NONNEGATIVE_LONG_MASK = 0x7FFFFFFFFFFFFFFFL;
Reported by PMD.
Line: 42
long[] xLongs;
long[] yLongs;
int[] constant;
private static final long NONNEGATIVE_LONG_MASK = 0x7FFFFFFFFFFFFFFFL;
@BeforeExperiment
void setUp() {
Reported by PMD.
Line: 46
private static final long NONNEGATIVE_LONG_MASK = 0x7FFFFFFFFFFFFFFFL;
@BeforeExperiment
void setUp() {
Random random = new Random(randomSeed);
xInts = new int[SAMPLE_SIZE];
yInts = new int[SAMPLE_SIZE];
xLongs = new long[SAMPLE_SIZE];
Reported by PMD.
Line: 48
@BeforeExperiment
void setUp() {
Random random = new Random(randomSeed);
xInts = new int[SAMPLE_SIZE];
yInts = new int[SAMPLE_SIZE];
xLongs = new long[SAMPLE_SIZE];
yLongs = new long[SAMPLE_SIZE];
constant = new int[SAMPLE_SIZE];
Reported by PMD.
android/guava-tests/benchmark/com/google/common/math/QuantilesBenchmark.java
8 issues
Line: 35
ContiguousSet.create(Range.closed(0, 10), DiscreteDomain.integers());
@Param({"10", "100", "1000", "10000", "100000"})
int datasetSize;
@Param QuantilesAlgorithm algorithm;
private double[][] datasets = new double[0x100][];
Reported by PMD.
Line: 37
@Param({"10", "100", "1000", "10000", "100000"})
int datasetSize;
@Param QuantilesAlgorithm algorithm;
private double[][] datasets = new double[0x100][];
@BeforeExperiment
void setUp() {
Reported by PMD.
Line: 39
@Param QuantilesAlgorithm algorithm;
private double[][] datasets = new double[0x100][];
@BeforeExperiment
void setUp() {
Random rng = new Random();
for (int i = 0; i < 0x100; i++) {
Reported by PMD.
Line: 41
private double[][] datasets = new double[0x100][];
@BeforeExperiment
void setUp() {
Random rng = new Random();
for (int i = 0; i < 0x100; i++) {
datasets[i] = new double[datasetSize];
for (int j = 0; j < datasetSize; j++) {
Reported by PMD.
Line: 89
double percentiles90And99(int reps) {
double dummy = 0.0;
for (int i = 0; i < reps; i++) {
dummy += algorithm.multipleQuantiles(ImmutableSet.of(90, 99), 100, dataset(i)).get(90);
}
return dummy;
}
@Benchmark
Reported by PMD.
Line: 98
double threePercentiles(int reps) {
double dummy = 0.0;
for (int i = 0; i < reps; i++) {
dummy += algorithm.multipleQuantiles(ImmutableSet.of(90, 95, 99), 100, dataset(i)).get(90);
}
return dummy;
}
@Benchmark
Reported by PMD.
Line: 107
double allDeciles(int reps) {
double dummy = 0.0;
for (int i = 0; i < reps; i++) {
dummy += algorithm.multipleQuantiles(ALL_DECILE_INDEXES, 10, dataset(i)).get(9);
}
return dummy;
}
}
Reported by PMD.
Line: 43
@BeforeExperiment
void setUp() {
Random rng = new Random();
for (int i = 0; i < 0x100; i++) {
datasets[i] = new double[datasetSize];
for (int j = 0; j < datasetSize; j++) {
datasets[i][j] = rng.nextDouble();
}
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/AbstractCollectionTester.java
8 issues
Line: 35
extends AbstractContainerTester<Collection<E>, E> {
// TODO: replace this with an accessor.
protected Collection<E> collection;
@Override
protected Collection<E> actualContents() {
return collection;
}
Reported by PMD.
Line: 57
/** @return an array of the proper size with {@code null} inserted into the middle element. */
protected E[] createArrayWithNullElement() {
E[] array = createSamplesArray();
array[getNullLocation()] = null;
return array;
}
protected void initCollectionWithNullElement() {
E[] array = createArrayWithNullElement();
Reported by PMD.
Line: 63
protected void initCollectionWithNullElement() {
E[] array = createArrayWithNullElement();
resetContainer(getSubjectGenerator().create(array));
}
/**
* Equivalent to {@link #expectMissing(Object[]) expectMissing}{@code (null)} except that the call
* to {@code contains(null)} is permitted to throw a {@code NullPointerException}.
Reported by PMD.
Line: 74
*/
protected void expectNullMissingWhenNullUnsupported(String message) {
try {
assertFalse(message, actualContents().contains(null));
} catch (NullPointerException tolerated) {
// Tolerated
}
}
}
Reported by PMD.
Line: 75
protected void expectNullMissingWhenNullUnsupported(String message) {
try {
assertFalse(message, actualContents().contains(null));
} catch (NullPointerException tolerated) {
// Tolerated
}
}
}
Reported by PMD.
Line: 75
protected void expectNullMissingWhenNullUnsupported(String message) {
try {
assertFalse(message, actualContents().contains(null));
} catch (NullPointerException tolerated) {
// Tolerated
}
}
}
Reported by PMD.
Line: 75
protected void expectNullMissingWhenNullUnsupported(String message) {
try {
assertFalse(message, actualContents().contains(null));
} catch (NullPointerException tolerated) {
// Tolerated
}
}
}
Reported by PMD.
Line: 56
/** @return an array of the proper size with {@code null} inserted into the middle element. */
protected E[] createArrayWithNullElement() {
E[] array = createSamplesArray();
array[getNullLocation()] = null;
return array;
}
protected void initCollectionWithNullElement() {
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/testers/ListAddTester.java
8 issues
Line: 42
@GwtCompatible(emulated = true)
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListAddTester<E> extends AbstractListTester<E> {
@CollectionFeature.Require(SUPPORTS_ADD)
@CollectionSize.Require(absent = ZERO)
public void testAdd_supportedPresent() {
assertTrue("add(present) should return true", getList().add(e0()));
expectAdded(e0());
}
Reported by PMD.
Line: 45
@CollectionFeature.Require(SUPPORTS_ADD)
@CollectionSize.Require(absent = ZERO)
public void testAdd_supportedPresent() {
assertTrue("add(present) should return true", getList().add(e0()));
expectAdded(e0());
}
@CollectionFeature.Require(absent = SUPPORTS_ADD)
@CollectionSize.Require(absent = ZERO)
Reported by PMD.
Line: 49
expectAdded(e0());
}
@CollectionFeature.Require(absent = SUPPORTS_ADD)
@CollectionSize.Require(absent = ZERO)
/*
* absent = ZERO isn't required, since unmodList.add() must
* throw regardless, but it keeps the method name accurate.
*/
Reported by PMD.
Line: 57
*/
public void testAdd_unsupportedPresent() {
try {
getList().add(e0());
fail("add(present) should throw");
} catch (UnsupportedOperationException expected) {
}
}
Reported by PMD.
Line: 63
}
}
@CollectionFeature.Require(value = {SUPPORTS_ADD, ALLOWS_NULL_VALUES})
@CollectionSize.Require(absent = ZERO)
public void testAdd_supportedNullPresent() {
E[] array = createArrayWithNullElement();
collection = getSubjectGenerator().create(array);
assertTrue("add(nullPresent) should return true", getList().add(null));
Reported by PMD.
Line: 67
@CollectionSize.Require(absent = ZERO)
public void testAdd_supportedNullPresent() {
E[] array = createArrayWithNullElement();
collection = getSubjectGenerator().create(array);
assertTrue("add(nullPresent) should return true", getList().add(null));
List<E> expected = Helpers.copyToList(array);
expected.add(null);
expectContents(expected);
Reported by PMD.
Line: 68
public void testAdd_supportedNullPresent() {
E[] array = createArrayWithNullElement();
collection = getSubjectGenerator().create(array);
assertTrue("add(nullPresent) should return true", getList().add(null));
List<E> expected = Helpers.copyToList(array);
expected.add(null);
expectContents(expected);
}
Reported by PMD.
Line: 71
assertTrue("add(nullPresent) should return true", getList().add(null));
List<E> expected = Helpers.copyToList(array);
expected.add(null);
expectContents(expected);
}
/**
* Returns the {@link Method} instance for {@link #testAdd_supportedNullPresent()} so that tests
Reported by PMD.
android/guava-testlib/src/com/google/common/collect/testing/testers/CollectionContainsTester.java
8 issues
Line: 40
@GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionContainsTester<E> extends AbstractCollectionTester<E> {
@CollectionSize.Require(absent = ZERO)
public void testContains_yes() {
assertTrue("contains(present) should return true", collection.contains(e0()));
}
public void testContains_no() {
Reported by PMD.
Line: 45
assertTrue("contains(present) should return true", collection.contains(e0()));
}
public void testContains_no() {
assertFalse("contains(notPresent) should return false", collection.contains(e3()));
}
@CollectionFeature.Require(ALLOWS_NULL_QUERIES)
public void testContains_nullNotContainedButQueriesSupported() {
Reported by PMD.
Line: 49
assertFalse("contains(notPresent) should return false", collection.contains(e3()));
}
@CollectionFeature.Require(ALLOWS_NULL_QUERIES)
public void testContains_nullNotContainedButQueriesSupported() {
assertFalse("contains(null) should return false", collection.contains(null));
}
@CollectionFeature.Require(absent = ALLOWS_NULL_QUERIES)
Reported by PMD.
Line: 54
assertFalse("contains(null) should return false", collection.contains(null));
}
@CollectionFeature.Require(absent = ALLOWS_NULL_QUERIES)
public void testContains_nullNotContainedAndUnsupported() {
expectNullMissingWhenNullUnsupported("contains(null) should return false or throw");
}
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
Reported by PMD.
Line: 59
expectNullMissingWhenNullUnsupported("contains(null) should return false or throw");
}
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
@CollectionSize.Require(absent = ZERO)
public void testContains_nonNullWhenNullContained() {
initCollectionWithNullElement();
assertFalse("contains(notPresent) should return false", collection.contains(e3()));
}
Reported by PMD.
Line: 66
assertFalse("contains(notPresent) should return false", collection.contains(e3()));
}
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
@CollectionSize.Require(absent = ZERO)
public void testContains_nullContained() {
initCollectionWithNullElement();
assertTrue("contains(null) should return true", collection.contains(null));
}
Reported by PMD.
Line: 73
assertTrue("contains(null) should return true", collection.contains(null));
}
public void testContains_wrongType() {
try {
assertFalse(
"contains(wrongType) should return false or throw", collection.contains(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
Reported by PMD.
Line: 77
try {
assertFalse(
"contains(wrongType) should return false or throw", collection.contains(WrongType.VALUE));
} catch (ClassCastException tolerated) {
}
}
}
Reported by PMD.