The following issues were found

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

Line: 35

                void setCountCheckReturnValue(E element, int count) {
    assertEquals(
        "multiset.setCount() should return the old count",
        getMultiset().count(element),
        setCount(element, count));
  }

  @Override
  void setCountNoCheckReturnValue(E element, int count) {

            

Reported by PMD.

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

Line: 45

                }

  private int setCount(E element, int count) {
    return getMultiset().setCount(element, count);
  }
}

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/ForwardingListIteratorTest.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: 31

               */
public class ForwardingListIteratorTest extends TestCase {

  @SuppressWarnings("rawtypes")
  public void testForwarding() {
    new ForwardingWrapperTester()
        .testForwarding(
            ListIterator.class,
            new Function<ListIterator, ListIterator>() {

            

Reported by PMD.

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

Line: 32

              public class ForwardingListIteratorTest extends TestCase {

  @SuppressWarnings("rawtypes")
  public void testForwarding() {
    new ForwardingWrapperTester()
        .testForwarding(
            ListIterator.class,
            new Function<ListIterator, ListIterator>() {
              @Override

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/ForwardingDequeTest.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: 31

               */
public class ForwardingDequeTest extends TestCase {

  @SuppressWarnings("rawtypes")
  public void testForwarding() {
    new ForwardingWrapperTester()
        .testForwarding(
            Deque.class,
            new Function<Deque, Deque>() {

            

Reported by PMD.

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

Line: 32

              public class ForwardingDequeTest extends TestCase {

  @SuppressWarnings("rawtypes")
  public void testForwarding() {
    new ForwardingWrapperTester()
        .testForwarding(
            Deque.class,
            new Function<Deque, Deque>() {
              @Override

            

Reported by PMD.

android/guava-testlib/test/com/google/common/collect/testing/MinimalSetTest.java
2 issues
This class name ends with Test but contains no test cases
Error

Line: 30

               *
 * @author Regina O'Dell
 */
public class MinimalSetTest extends TestCase {
  public static Test suite() {
    return SetTestSuiteBuilder.using(
            new TestStringSetGenerator() {
              @Override
              protected Set<String> create(String[] elements) {

            

Reported by PMD.

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

Line: 31

               * @author Regina O'Dell
 */
public class MinimalSetTest extends TestCase {
  public static Test suite() {
    return SetTestSuiteBuilder.using(
            new TestStringSetGenerator() {
              @Override
              protected Set<String> create(String[] elements) {
                return MinimalSet.of(elements);

            

Reported by PMD.

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

Line: 42

              @GwtCompatible
public class FakeTicker extends Ticker {

  private final AtomicLong nanos = new AtomicLong();
  private volatile long autoIncrementStepNanos;

  /** Advances the ticker value by {@code time} in {@code timeUnit}. */
  @SuppressWarnings("GoodTime") // should accept a java.time.Duration
  public FakeTicker advance(long time, TimeUnit timeUnit) {

            

Reported by PMD.

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

Line: 43

              public class FakeTicker extends Ticker {

  private final AtomicLong nanos = new AtomicLong();
  private volatile long autoIncrementStepNanos;

  /** Advances the ticker value by {@code time} in {@code timeUnit}. */
  @SuppressWarnings("GoodTime") // should accept a java.time.Duration
  public FakeTicker advance(long time, TimeUnit timeUnit) {
    return advance(timeUnit.toNanos(time));

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/BenchmarkHelpers.java
2 issues
Potential violation of Law of Demeter (object not created locally)
Design

Line: 256

                    @Override
      public <K extends Comparable<K>, V> SortedMap<K, V> create(Map<K, V> map) {
        SortedMap<K, V> result = Maps.newTreeMap();
        result.putAll(map);
        return result;
      }
    },
    ConcurrentSkipListImpl {
      @Override

            

Reported by PMD.

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

Line: 356

                    <R extends Comparable<R>, C extends Comparable<C>, V> Table<R, C, V> create(
          Table<R, C, V> contents) {
        Table<R, C, V> table = TreeBasedTable.create();
        table.putAll(contents);
        return table;
      }
    },
    ArrayTableImpl {
      @Override

            

Reported by PMD.

android/guava-tests/test/com/google/common/cache/TestingWeighers.java
2 issues
All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 22

               *
 * @author Charles Fry
 */
public class TestingWeighers {

  /** Returns a {@link Weigher} that returns the given {@code constant} for every request. */
  static Weigher<Object, Object> constantWeigher(int constant) {
    return new ConstantWeigher(constant);
  }

            

Reported by PMD.

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

Line: 40

                }

  static final class ConstantWeigher implements Weigher<Object, Object> {
    private final int constant;

    ConstantWeigher(int constant) {
      this.constant = constant;
    }


            

Reported by PMD.

android/guava-tests/test/com/google/common/cache/RemovalNotificationTest.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: 29

               */
public class RemovalNotificationTest extends TestCase {

  public void testEquals() {
    new EqualsTester()
        .addEqualityGroup(
            RemovalNotification.create("one", 1, RemovalCause.EXPLICIT),
            RemovalNotification.create("one", 1, RemovalCause.REPLACED))
        .addEqualityGroup(RemovalNotification.create("1", 1, RemovalCause.EXPLICIT))

            

Reported by PMD.

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

Line: 29

               */
public class RemovalNotificationTest extends TestCase {

  public void testEquals() {
    new EqualsTester()
        .addEqualityGroup(
            RemovalNotification.create("one", 1, RemovalCause.EXPLICIT),
            RemovalNotification.create("one", 1, RemovalCause.REPLACED))
        .addEqualityGroup(RemovalNotification.create("1", 1, RemovalCause.EXPLICIT))

            

Reported by PMD.

android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.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: 28

               */
public class CountingOutputStreamTest extends IoTestCase {

  public void testCount() throws Exception {
    int written = 0;
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    CountingOutputStream counter = new CountingOutputStream(out);
    assertEquals(written, out.size());
    assertEquals(written, counter.getCount());

            

Reported by PMD.

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

Line: 28

               */
public class CountingOutputStreamTest extends IoTestCase {

  public void testCount() throws Exception {
    int written = 0;
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    CountingOutputStream counter = new CountingOutputStream(out);
    assertEquals(written, out.size());
    assertEquals(written, counter.getCount());

            

Reported by PMD.

android/guava-testlib/src/com/google/common/collect/testing/testers/MapSizeTester.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: 32

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

            

Reported by PMD.

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

Line: 33

              @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class MapSizeTester<K, V> extends AbstractMapTester<K, V> {
  public void testSize() {
    assertEquals("size():", getNumElements(), getMap().size());
  }
}

            

Reported by PMD.