The following issues were found

guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java
194 issues
A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.math;

import static com.google.common.math.StatsTesting.ALLOWED_ERROR;
import static com.google.common.math.StatsTesting.ALL_MANY_VALUES;
import static com.google.common.math.StatsTesting.EMPTY_STATS_ITERABLE;
import static com.google.common.math.StatsTesting.MANY_VALUES;

            

Reported by PMD.

The class 'PairedStatsAccumulatorTest' has a Modified Cyclomatic Complexity of 4 (Highest = 13).
Design

Line: 60

               *
 * @author Pete Gillin
 */
public class PairedStatsAccumulatorTest extends TestCase {

  private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;

            

Reported by PMD.

The class 'PairedStatsAccumulatorTest' has a Standard Cyclomatic Complexity of 4 (Highest = 13).
Design

Line: 60

               *
 * @author Pete Gillin
 */
public class PairedStatsAccumulatorTest extends TestCase {

  private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 62

               */
public class PairedStatsAccumulatorTest extends TestCase {

  private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 63

              public class PairedStatsAccumulatorTest extends TestCase {

  private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 64

              
  private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;
  private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 65

                private PairedStatsAccumulator emptyAccumulator;
  private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;
  private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator horizontalValuesAccumulator;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 66

                private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;
  private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator horizontalValuesAccumulator;
  private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 67

                private PairedStatsAccumulator oneValueAccumulator;
  private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;
  private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator horizontalValuesAccumulator;
  private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator verticalValuesAccumulator;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 68

                private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
  private PairedStatsAccumulator twoValuesAccumulator;
  private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator manyValuesAccumulator;
  private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator horizontalValuesAccumulator;
  private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;
  private PairedStatsAccumulator verticalValuesAccumulator;
  private PairedStatsAccumulator verticalValuesAccumulatorByAddAllPartitionedPairedStats;

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java
193 issues
This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;


            

Reported by PMD.

Possible God Class (WMC=69, ATFD=24, TCC=0.000%)
Design

Line: 54

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableMultisetTest extends TestCase {

  @GwtIncompatible // suite // TODO(cpovirk): add to collect/gwt/suites
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ImmutableMultisetTest.class);

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 54

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableMultisetTest extends TestCase {

  @GwtIncompatible // suite // TODO(cpovirk): add to collect/gwt/suites
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ImmutableMultisetTest.class);

            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 56

              @GwtCompatible(emulated = true)
public class ImmutableMultisetTest extends TestCase {

  @GwtIncompatible // suite // TODO(cpovirk): add to collect/gwt/suites
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ImmutableMultisetTest.class);

    suite.addTest(

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 81

                              new TestStringSetGenerator() {
                  @Override
                  protected Set<String> create(String[] elements) {
                    return ImmutableMultiset.copyOf(elements).elementSet();
                  }
                })
            .named("ImmutableMultiset, element set")
            .withFeatures(
                CollectionSize.ANY,

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 96

                              new TestStringListGenerator() {
                  @Override
                  protected List<String> create(String[] elements) {
                    return ImmutableMultiset.copyOf(elements).asList();
                  }

                  @Override
                  public List<String> order(List<String> insertionOrder) {
                    List<String> order = new ArrayList<>();

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 132

                                    builder.addCopies(s, 2);
                    }
                    ImmutableSet<String> elementSet =
                        (ImmutableSet<String>) builder.build().elementSet();
                    return elementSet.asList();
                  }
                })
            .named("ImmutableMultiset.elementSet.asList")
            .withFeatures(

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 133

                                  }
                    ImmutableSet<String> elementSet =
                        (ImmutableSet<String>) builder.build().elementSet();
                    return elementSet.asList();
                  }
                })
            .named("ImmutableMultiset.elementSet.asList")
            .withFeatures(
                CollectionSize.ANY,

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 147

                  return suite;
  }

  public void testCreation_noArgs() {
    Multiset<String> multiset = ImmutableMultiset.of();
    assertTrue(multiset.isEmpty());
  }

  public void testCreation_oneElement() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 149

              
  public void testCreation_noArgs() {
    Multiset<String> multiset = ImmutableMultiset.of();
    assertTrue(multiset.isEmpty());
  }

  public void testCreation_oneElement() {
    Multiset<String> multiset = ImmutableMultiset.of("a");
    assertEquals(HashMultiset.create(asList("a")), multiset);

            

Reported by PMD.

guava-tests/test/com/google/common/hash/MacHashFunctionTest.java
191 issues
Return an empty array rather than null.
Error

Line: 158

                        }

          @Override
          public byte[] getEncoded() {
            return null;
          }

          @Override
          public String getFormat() {

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 40

               *
 * @author Kurt Alfred Kluever
 */
public class MacHashFunctionTest extends TestCase {

  private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");

            

Reported by PMD.

The String literal 'HmacMD5' appears 10 times in this file; the first occurrence is on line 45
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

The String literal 'secret key' appears 5 times in this file; the first occurrence is on line 45
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 47

                private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");


            

Reported by PMD.

The String literal 'HmacSHA1' appears 4 times in this file; the first occurrence is on line 47
Error

Line: 47

                private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");


            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 49

                private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");

  // From http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
  private static final ImmutableTable<String, SecretKey, HashFunction> ALGORITHMS =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 51

                private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");

  // From http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
  private static final ImmutableTable<String, SecretKey, HashFunction> ALGORITHMS =
      new ImmutableTable.Builder<String, SecretKey, HashFunction>()
          .put("HmacMD5", MD5_KEY, Hashing.hmacMd5(MD5_KEY))

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 62

                        .put("HmacSHA512", SHA512_KEY, Hashing.hmacSha512(SHA512_KEY))
          .build();

  public void testNulls() {
    NullPointerTester tester =
        new NullPointerTester().setDefault(String.class, "HmacMD5").setDefault(Key.class, MD5_KEY);
    tester.testAllPublicConstructors(MacHashFunction.class);
    tester.testAllPublicInstanceMethods(new MacHashFunction("HmacMD5", MD5_KEY, "toString"));
  }

            

Reported by PMD.

android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java
191 issues
Return an empty array rather than null.
Error

Line: 158

                        }

          @Override
          public byte[] getEncoded() {
            return null;
          }

          @Override
          public String getFormat() {

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 40

               *
 * @author Kurt Alfred Kluever
 */
public class MacHashFunctionTest extends TestCase {

  private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");

            

Reported by PMD.

The String literal 'HmacMD5' appears 10 times in this file; the first occurrence is on line 45
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

The String literal 'secret key' appears 5 times in this file; the first occurrence is on line 45
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 45

                private static final ImmutableSet<String> INPUTS = ImmutableSet.of("", "Z", "foobar");

  private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 47

                private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");


            

Reported by PMD.

The String literal 'HmacSHA1' appears 4 times in this file; the first occurrence is on line 47
Error

Line: 47

                private static final SecretKey MD5_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
  private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");


            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 49

                private static final SecretKey SHA1_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
  private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");

  // From http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
  private static final ImmutableTable<String, SecretKey, HashFunction> ALGORITHMS =

            

Reported by PMD.

Do not use hard coded encryption keys
Error

Line: 51

                private static final SecretKey SHA256_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
  private static final SecretKey SHA512_KEY =
      new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");

  // From http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Mac
  private static final ImmutableTable<String, SecretKey, HashFunction> ALGORITHMS =
      new ImmutableTable.Builder<String, SecretKey, HashFunction>()
          .put("HmacMD5", MD5_KEY, Hashing.hmacMd5(MD5_KEY))

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 62

                        .put("HmacSHA512", SHA512_KEY, Hashing.hmacSha512(SHA512_KEY))
          .build();

  public void testNulls() {
    NullPointerTester tester =
        new NullPointerTester().setDefault(String.class, "HmacMD5").setDefault(Key.class, MD5_KEY);
    tester.testAllPublicConstructors(MacHashFunction.class);
    tester.testAllPublicInstanceMethods(new MacHashFunction("HmacMD5", MD5_KEY, "toString"));
  }

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/EvictingQueueTest.java
189 issues
This class has too many methods, consider refactoring it.
Design

Line: 34

               * @author Kurt Alfred Kluever
 */
@GwtCompatible(emulated = true)
public class EvictingQueueTest extends TestCase {

  public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 36

              @GwtCompatible(emulated = true)
public class EvictingQueueTest extends TestCase {

  public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }

            

Reported by PMD.

In JUnit4, use the @Test(expected) annotation to denote tests that should throw exceptions
Design

Line: 39

                public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testCreateWithZeroSize() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

                public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testCreateWithZeroSize() throws Exception {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 44

                  }
  }

  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 44

                  }
  }

  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 46

              
  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 46

              
  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                  EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));
    assertEquals(0, queue.size());


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 48

                  EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));
    assertEquals(0, queue.size());


            

Reported by PMD.

guava-tests/test/com/google/common/collect/EvictingQueueTest.java
189 issues
This class has too many methods, consider refactoring it.
Design

Line: 34

               * @author Kurt Alfred Kluever
 */
@GwtCompatible(emulated = true)
public class EvictingQueueTest extends TestCase {

  public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 36

              @GwtCompatible(emulated = true)
public class EvictingQueueTest extends TestCase {

  public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }

            

Reported by PMD.

In JUnit4, use the @Test(expected) annotation to denote tests that should throw exceptions
Design

Line: 39

                public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testCreateWithZeroSize() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

                public void testCreateWithNegativeSize() throws Exception {
    try {
      EvictingQueue.create(-1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testCreateWithZeroSize() throws Exception {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 44

                  }
  }

  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 44

                  }
  }

  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 46

              
  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 46

              
  public void testCreateWithZeroSize() throws Exception {
    EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 48

                  EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));
    assertEquals(0, queue.size());


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 48

                  EvictingQueue<String> queue = EvictingQueue.create(0);
    assertEquals(0, queue.size());

    assertTrue(queue.add("hi"));
    assertEquals(0, queue.size());

    assertTrue(queue.offer("hi"));
    assertEquals(0, queue.size());


            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/LinkedHashMultimapTest.java
185 issues
This class has too many methods, consider refactoring it.
Design

Line: 53

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class LinkedHashMultimapTest extends TestCase {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(

            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 55

              @GwtCompatible(emulated = true)
public class LinkedHashMultimapTest extends TestCase {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(
        SetMultimapTestSuiteBuilder.using(
                new TestStringSetMultimapGenerator() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 86

                  return suite;
  }

  public void testValueSetHashTableExpansion() {
    LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create();
    for (int z = 1; z <= 100; z++) {
      multimap.put("a", z);
      // The Eclipse compiler (and hence GWT) rejects a parameterized cast.
      @SuppressWarnings("unchecked")

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 86

                  return suite;
  }

  public void testValueSetHashTableExpansion() {
    LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create();
    for (int z = 1; z <= 100; z++) {
      multimap.put("a", z);
      // The Eclipse compiler (and hence GWT) rejects a parameterized cast.
      @SuppressWarnings("unchecked")

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 93

                    // The Eclipse compiler (and hence GWT) rejects a parameterized cast.
      @SuppressWarnings("unchecked")
      LinkedHashMultimap<String, Integer>.ValueSet valueSet =
          (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
      assertEquals(z, valueSet.size());
      assertFalse(
          Hashing.needsResizing(
              valueSet.size(),
              valueSet.hashTable.length,

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 94

                    @SuppressWarnings("unchecked")
      LinkedHashMultimap<String, Integer>.ValueSet valueSet =
          (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
      assertEquals(z, valueSet.size());
      assertFalse(
          Hashing.needsResizing(
              valueSet.size(),
              valueSet.hashTable.length,
              LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 94

                    @SuppressWarnings("unchecked")
      LinkedHashMultimap<String, Integer>.ValueSet valueSet =
          (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
      assertEquals(z, valueSet.size());
      assertFalse(
          Hashing.needsResizing(
              valueSet.size(),
              valueSet.hashTable.length,
              LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 95

                    LinkedHashMultimap<String, Integer>.ValueSet valueSet =
          (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
      assertEquals(z, valueSet.size());
      assertFalse(
          Hashing.needsResizing(
              valueSet.size(),
              valueSet.hashTable.length,
              LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
    }

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 97

                    assertEquals(z, valueSet.size());
      assertFalse(
          Hashing.needsResizing(
              valueSet.size(),
              valueSet.hashTable.length,
              LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
    }
  }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 105

              
  private Multimap<String, Integer> initializeMultimap5() {
    Multimap<String, Integer> multimap = LinkedHashMultimap.create();
    multimap.put("foo", 5);
    multimap.put("bar", 4);
    multimap.put("foo", 3);
    multimap.put("cow", 2);
    multimap.put("bar", 1);
    return multimap;

            

Reported by PMD.

android/guava-tests/test/com/google/common/graph/ValueGraphTest.java
185 issues
This class has too many methods, consider refactoring it.
Design

Line: 39

              /** Tests for {@link StandardMutableValueGraph} and related functionality. */
// TODO(user): Expand coverage and move to proper test suite.
@RunWith(JUnit4.class)
public final class ValueGraphTest {
  private static final String DEFAULT = "default";

  MutableValueGraph<Integer, String> graph;

  @After

            

Reported by PMD.

The String literal 'default' appears 10 times in this file; the first occurrence is on line 40
Error

Line: 40

              // TODO(user): Expand coverage and move to proper test suite.
@RunWith(JUnit4.class)
public final class ValueGraphTest {
  private static final String DEFAULT = "default";

  MutableValueGraph<Integer, String> graph;

  @After
  public void validateGraphState() {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 42

              public final class ValueGraphTest {
  private static final String DEFAULT = "default";

  MutableValueGraph<Integer, String> graph;

  @After
  public void validateGraphState() {
    assertStronglyEquivalent(graph, Graphs.copyOf(graph));
    assertStronglyEquivalent(graph, ImmutableValueGraph.copyOf(graph));

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 51

              
    Graph<Integer> asGraph = graph.asGraph();
    AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 51

              
    Graph<Integer> asGraph = graph.asGraph();
    AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 52

                  Graph<Integer> asGraph = graph.asGraph();
    AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 52

                  Graph<Integer> asGraph = graph.asGraph();
    AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 53

                  AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());

    for (Integer node : graph.nodes()) {

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 53

                  AbstractGraphTest.validateGraph(asGraph);
    assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());

    for (Integer node : graph.nodes()) {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 54

                  assertThat(graph.nodes()).isEqualTo(asGraph.nodes());
    assertThat(graph.edges()).isEqualTo(asGraph.edges());
    assertThat(graph.nodeOrder()).isEqualTo(asGraph.nodeOrder());
    assertThat(graph.incidentEdgeOrder()).isEqualTo(asGraph.incidentEdgeOrder());
    assertThat(graph.isDirected()).isEqualTo(asGraph.isDirected());
    assertThat(graph.allowsSelfLoops()).isEqualTo(asGraph.allowsSelfLoops());

    for (Integer node : graph.nodes()) {
      assertThat(graph.adjacentNodes(node)).isEqualTo(asGraph.adjacentNodes(node));

            

Reported by PMD.

guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java
183 issues
A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * the License.
 */

package com.google.common.util.concurrent;

import static com.google.common.util.concurrent.InterruptionUtil.repeatedlyInterruptTestThread;
import static com.google.common.util.concurrent.Uninterruptibles.awaitTerminationUninterruptibly;
import static com.google.common.util.concurrent.Uninterruptibles.awaitUninterruptibly;
import static com.google.common.util.concurrent.Uninterruptibles.joinUninterruptibly;

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 17

               * the License.
 */

package com.google.common.util.concurrent;

import static com.google.common.util.concurrent.InterruptionUtil.repeatedlyInterruptTestThread;
import static com.google.common.util.concurrent.Uninterruptibles.awaitTerminationUninterruptibly;
import static com.google.common.util.concurrent.Uninterruptibles.awaitUninterruptibly;
import static com.google.common.util.concurrent.Uninterruptibles.joinUninterruptibly;

            

Reported by PMD.

Possible God Class (WMC=61, ATFD=10, TCC=28.404%)
Design

Line: 59

               * @author Anthony Zana
 */

public class UninterruptiblesTest extends TestCase {
  private static final String EXPECTED_TAKE = "expectedTake";

  /** Timeout to use when we don't expect the timeout to expire. */
  private static final long LONG_DELAY_MS = 2500;


            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 59

               * @author Anthony Zana
 */

public class UninterruptiblesTest extends TestCase {
  private static final String EXPECTED_TAKE = "expectedTake";

  /** Timeout to use when we don't expect the timeout to expire. */
  private static final long LONG_DELAY_MS = 2500;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 67

              
  private static final long SLEEP_SLACK = 2;

  private final TearDownStack tearDownStack = new TearDownStack();

  // NOTE: All durations in these tests are expressed in milliseconds
  @Override
  protected void setUp() {
    // Clear any previous interrupt before running the test.

            

Reported by PMD.

JUnit 4 tests that set up tests should use the @Before annotation, JUnit5 tests should use @BeforeEach or @BeforeAll
Design

Line: 70

                private final TearDownStack tearDownStack = new TearDownStack();

  // NOTE: All durations in these tests are expressed in milliseconds
  @Override
  protected void setUp() {
    // Clear any previous interrupt before running the test.
    if (Thread.currentThread().isInterrupted()) {
      throw new AssertionError(
          "Thread interrupted on test entry. "

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 73

                @Override
  protected void setUp() {
    // Clear any previous interrupt before running the test.
    if (Thread.currentThread().isInterrupted()) {
      throw new AssertionError(
          "Thread interrupted on test entry. "
              + "Some test probably didn't clear the interrupt state");
    }


            

Reported by PMD.

JUnit 4 tests that clean up tests should use the @After annotation, JUnit5 tests should use @AfterEach or @AfterAll
Design

Line: 81

              
    tearDownStack.addTearDown(
        new TearDown() {
          @Override
          public void tearDown() {
            Thread.interrupted();
          }
        });
  }

            

Reported by PMD.

JUnit 4 tests that clean up tests should use the @After annotation, JUnit5 tests should use @AfterEach or @AfterAll
Design

Line: 88

                      });
  }

  @Override
  protected void tearDown() {
    tearDownStack.runTearDown();
  }

  public void testNull() throws Exception {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 93

                  tearDownStack.runTearDown();
  }

  public void testNull() throws Exception {
    new NullPointerTester()
        .setDefault(CountDownLatch.class, new CountDownLatch(0))
        .setDefault(Semaphore.class, new Semaphore(999))
        .testAllPublicStaticMethods(Uninterruptibles.class);
  }

            

Reported by PMD.

guava-tests/test/com/google/common/hash/BloomFilterTest.java
182 issues
The class 'BloomFilterTest' has a total cyclomatic complexity of 82 (highest 7).
Design

Line: 48

               *
 * @author Dimitris Andreou
 */
public class BloomFilterTest extends TestCase {
  private static final int NUM_PUTS = 100_000;
  private static final ThreadLocal<Random> random =
      new ThreadLocal<Random>() {
        @Override
        protected Random initialValue() {

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 48

               *
 * @author Dimitris Andreou
 */
public class BloomFilterTest extends TestCase {
  private static final int NUM_PUTS = 100_000;
  private static final ThreadLocal<Random> random =
      new ThreadLocal<Random>() {
        @Override
        protected Random initialValue() {

            

Reported by PMD.

Possible God Class (WMC=82, ATFD=26, TCC=0.635%)
Design

Line: 48

               *
 * @author Dimitris Andreou
 */
public class BloomFilterTest extends TestCase {
  private static final int NUM_PUTS = 100_000;
  private static final ThreadLocal<Random> random =
      new ThreadLocal<Random>() {
        @Override
        protected Random initialValue() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 60

              
  private static final int GOLDEN_PRESENT_KEY = random.get().nextInt();

  @AndroidIncompatible // OutOfMemoryError
  public void testLargeBloomFilterDoesntOverflow() {
    long numBits = Integer.MAX_VALUE;
    numBits++;

    LockFreeBitArray bitArray = new LockFreeBitArray(numBits);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 83

                  assertThat(bf.approximateElementCount()).isAtMost((long) (sizeGuess * 1.01));
  }

  public void testCreateAndCheckMitz32BloomFilterWithKnownFalsePositives() {
    int numInsertions = 1000000;
    BloomFilter<String> bf =
        BloomFilter.create(
            Funnels.unencodedCharsFunnel(),
            numInsertions,

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 83

                  assertThat(bf.approximateElementCount()).isAtMost((long) (sizeGuess * 1.01));
  }

  public void testCreateAndCheckMitz32BloomFilterWithKnownFalsePositives() {
    int numInsertions = 1000000;
    BloomFilter<String> bf =
        BloomFilter.create(
            Funnels.unencodedCharsFunnel(),
            numInsertions,

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 100

              
    // Assert that the BF "might" have all of the even numbers.
    for (int i = 0; i < numInsertions * 2; i += 2) {
      assertTrue(bf.mightContain(Integer.toString(i)));
    }

    // Now we check for known false positives using a set of known false positives.
    // (These are all of the false positives under 900.)
    ImmutableSet<Integer> falsePositives =

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 122

                      numFpp++;
      }
    }
    assertEquals(knownNumberOfFalsePositives, numFpp);
    double expectedReportedFpp = (double) knownNumberOfFalsePositives / numInsertions;
    double actualReportedFpp = bf.expectedFpp();
    assertEquals(expectedReportedFpp, actualReportedFpp, 0.00015);
  }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 124

                  }
    assertEquals(knownNumberOfFalsePositives, numFpp);
    double expectedReportedFpp = (double) knownNumberOfFalsePositives / numInsertions;
    double actualReportedFpp = bf.expectedFpp();
    assertEquals(expectedReportedFpp, actualReportedFpp, 0.00015);
  }

  public void testCreateAndCheckBloomFilterWithKnownFalsePositives64() {
    int numInsertions = 1000000;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 125

                  assertEquals(knownNumberOfFalsePositives, numFpp);
    double expectedReportedFpp = (double) knownNumberOfFalsePositives / numInsertions;
    double actualReportedFpp = bf.expectedFpp();
    assertEquals(expectedReportedFpp, actualReportedFpp, 0.00015);
  }

  public void testCreateAndCheckBloomFilterWithKnownFalsePositives64() {
    int numInsertions = 1000000;
    BloomFilter<String> bf =

            

Reported by PMD.