The following issues were found

android/guava-tests/test/com/google/common/eventbus/outside/OutsideEventBusTest.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 37

                 * That is, even if exactly the same method works from inside the common.eventbus package tests,
   * it can fail here.
   */
  public void testAnonymous() {
    final AtomicReference<String> holder = new AtomicReference<>();
    final AtomicInteger deliveries = new AtomicInteger();
    EventBus bus = new EventBus();
    bus.register(
        new Object() {

            

Reported by PMD.

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

Line: 37

                 * That is, even if exactly the same method works from inside the common.eventbus package tests,
   * it can fail here.
   */
  public void testAnonymous() {
    final AtomicReference<String> holder = new AtomicReference<>();
    final AtomicInteger deliveries = new AtomicInteger();
    EventBus bus = new EventBus();
    bus.register(
        new Object() {

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/QueueTestSuiteBuilder.java
1 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 41

                  return new QueueTestSuiteBuilder<E>().usingGenerator(generator);
  }

  private boolean runCollectionTests = true;

  /**
   * Specify whether to skip the general collection tests. Call this method when testing a
   * collection that's both a queue and a list, to avoid running the common collection tests twice.
   * By default, collection tests do run.

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/ReserializingTestCollectionGenerator.java
1 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 37

               */
@GwtIncompatible
public class ReserializingTestCollectionGenerator<E> implements TestCollectionGenerator<E> {
  private final TestCollectionGenerator<E> delegate;

  ReserializingTestCollectionGenerator(TestCollectionGenerator<E> delegate) {
    this.delegate = delegate;
  }


            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/UnhashableObject.java
1 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 28

               */
@GwtCompatible
public class UnhashableObject implements Comparable<UnhashableObject> {
  private final int value;

  public UnhashableObject(int value) {
    this.value = value;
  }


            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/features/CollectionSize.java
1 issues
Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 73

                  // Keep the order here, so that PerCollectionSizeTestSuiteBuilder
    // gives a predictable order of test suites.
    this.implied = Helpers.copyToSet(implied);
    this.numElements = null;
  }

  @Override
  public Set<Feature<? super Collection>> getImpliedFeatures() {
    return implied;

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetTester.java
1 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

                }

  protected void initThreeCopies() {
    collection = getSubjectGenerator().create(e0(), e0(), e0());
  }
}

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/LegacyComparable.java
1 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 40

                static final Iterable<LegacyComparable> VALUES_FORWARD = Arrays.asList(X, Y, Z);
  static final Iterable<LegacyComparable> VALUES_BACKWARD = Arrays.asList(Z, Y, X);

  private final String value;

  LegacyComparable(String value) {
    this.value = value;
  }


            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/testers/CollectionSerializationEqualTester.java
1 issues
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
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionSerializationEqualTester<E> extends AbstractCollectionTester<E> {
  @CollectionFeature.Require(SERIALIZABLE)
  public void testReserialize() {
    assertEquals(SerializableTester.reserialize(actualContents()), actualContents());
  }
}

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/testers/CollectionSerializationTester.java
1 issues
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
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionSerializationTester<E> extends AbstractCollectionTester<E> {
  @CollectionFeature.Require(SERIALIZABLE)
  public void testReserialize() {
    // For a bare Collection, the most we can guarantee is that the elements are preserved.
    Helpers.assertEqualIgnoringOrder(
        actualContents(), SerializableTester.reserialize(actualContents()));
  }

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/testers/CollectionSizeTester.java
1 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 32

              @GwtCompatible
@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class CollectionSizeTester<E> extends AbstractCollectionTester<E> {
  public void testSize() {
    assertEquals("size():", getNumElements(), collection.size());
  }
}

            

Reported by PMD.