Abstracting getter and setter method references for testing Is the following code easy to understand? If not how should it be changed to be more understandable. The purpose of this is reducing similar code in unit tests. This avoids repeating lines for calling getters, setters, and checking for equality.

/**
 * Example string for testing.
 */
private static final String STRING_EXAMPLE="stringExample";

/**
 * Test that a getter and setter are consistent.
 */
@Test
public void testGetterSettersForA() {
    A a = new A();
    assertGetterSetterConsistent(STRING_EXAMPLE,a::setC,a::getC);
}

/**
 * Assert that a getter and setter are consistent.
 * @param input the object to be set.
 * @param setter the setter.
 * @param getter the getter.
 */
private static &lt;T&gt; void assertGetterSetterConsistent(T input, Consumer&lt;T&gt; setter, Supplier&lt;T&gt; getter) {
    boolean consistent =isSetConsistentToGet(input,setter,getter);
    assertTrue("Getter and Setter should be consistent.",consistent);
}

/**
 * Check if the object being set is the same as the object being gotten.
 * @param input the object to be set.
 * @param setter the setter.
 * @param getter the getter.
 * @return whether the object being set is the same as the object being gotten.
 */
private static &lt;T&gt; boolean isSetConsistentToGet(T input, Consumer&lt;T&gt; setter, Supplier&lt;T&gt; getter) {
    setter.accept(input);
    T getValue = getter.get();
    return areEqual(input,getValue);
}

/**
 * Null safe check if two objects are equal.
 * @param first the first object.
 * @param second the second object.
 * @return whether the two objects are equal.
 */
private static &lt;T&gt; boolean areEqual(Object first, Object second) {
    if(first==null) {
        return second==null;
    }
    return first.equals(second);
}

/**
 * Class for testing a getter and setter.
 */
private static final class A{
    /**
     * Variable named c.
     */
    private String c;

    /**
     * Get c.
     * @return c.
     */
    public String getC() {
        return c;
    }

    /**
     * Set c.
     * @param c the value to be set.
     */
    public void setC(String c) {
        this.c = c;
    }
}
I had no issues, but I'm not sure if "easy to understand" is actually answerable.

There's still room for improvement, though: Your areEqual method can be replaced by Objects.equals.

private static &lt;T&gt; boolean isSetConsistentToGet(T input, Consumer&lt;T&gt; setter, Supplier&lt;T&gt; getter) {
    setter.accept(input);
    T getValue = getter.get();
    return Objects.equals(input, getValue);
}


Let me also throw in two frameworks that might make your life easier:


Project Lombok. Lombok can generate getters and setters for your fields, (IMHO) removing the necessity for writing any explicit tests completely.
OpenPojo. I haven't used that one yet, but it claims to do getter/setter validation automagically and has been suggested on Stack Overflow.