The following issues were found

guava-testlib/test/com/google/common/testing/RelationshipTesterTest.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 29

               */
public class RelationshipTesterTest extends TestCase {

  public void testNulls() {
    new ClassSanityTester()
        .setDefault(ItemReporter.class, new ItemReporter())
        .testNulls(RelationshipTester.class);
  }
}

            

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: 29

               */
public class RelationshipTesterTest extends TestCase {

  public void testNulls() {
    new ClassSanityTester()
        .setDefault(ItemReporter.class, new ItemReporter())
        .testNulls(RelationshipTester.class);
  }
}

            

Reported by PMD.

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: 43

              @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: 44

              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.

guava-tests/test/com/google/common/collect/UnmodifiableMultimapAsMapImplementsMapTest.java
2 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 39

              
  @Override
  protected Map<String, Collection<Integer>> makeEmptyMap() {
    return Multimaps.unmodifiableMultimap(LinkedHashMultimap.<String, Integer>create()).asMap();
  }

  @Override
  protected Map<String, Collection<Integer>> makePopulatedMap() {
    Multimap<String, Integer> delegate = LinkedHashMultimap.create();

            

Reported by PMD.

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

Line: 46

                protected Map<String, Collection<Integer>> makePopulatedMap() {
    Multimap<String, Integer> delegate = LinkedHashMultimap.create();
    populate(delegate);
    return Multimaps.unmodifiableMultimap(delegate).asMap();
  }
}

            

Reported by PMD.

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.

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.

guava-testlib/src/com/google/common/testing/TearDown.java
2 issues
JUnit 4 tests that clean up tests should use the @After annotation, JUnit5 tests should use @AfterEach or @AfterAll
Design

Line: 48

                 * @throws Exception for any reason. {@code TearDownTestCase} ensures that any exception thrown
   *     will not interfere with other TearDown operations.
   */
  void tearDown() throws Exception;
}

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 48

                 * @throws Exception for any reason. {@code TearDownTestCase} ensures that any exception thrown
   *     will not interfere with other TearDown operations.
   */
  void tearDown() throws Exception;
}

            

Reported by PMD.

guava-tests/test/com/google/common/eventbus/StringCatcher.java
2 issues
Private field 'events' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 33

               * @author Cliff Biffle
 */
public class StringCatcher {
  private List<String> events = Lists.newArrayList();

  @Subscribe
  public void hereHaveAString(@Nullable String string) {
    events.add(string);
  }

            

Reported by PMD.

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

Line: 33

               * @author Cliff Biffle
 */
public class StringCatcher {
  private List<String> events = Lists.newArrayList();

  @Subscribe
  public void hereHaveAString(@Nullable String string) {
    events.add(string);
  }

            

Reported by PMD.

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.

guava-tests/test/com/google/common/cache/RemovalNotificationTest.java
2 issues
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.

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.

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.