@Test
public void testEquals() {

    // przypadki testowe
    Object[][] pairs = {
        {new StringHolder("ab"), new StringHolder("ab"), true},
        {new StringHolder("ab"), new StringHolder("ac"), false},
        {new IntegerHolder(1L), new IntegerHolder(1L), true},
        {new IntegerHolder(1L), new StringHolder("1"), false},
        {new StringHolder("ab"), null, false}
    };
    // testy
    for (int i = 0; i < pairs.length; i++) {
        Object[] test = pairs[i];
        ValueHolder h1 = (ValueHolder) test[0];
        ValueHolder h2 = (ValueHolder) test[1];
        boolean expectedResult = (Boolean) test[2];
        // test 1
        boolean result = h1.equals(h2);
        assertEquals(expectedResult, result);
        // test 2
        if (h2 != null) {
            result = h2.equals(h1);
            assertEquals(expectedResult, result);
        }
    }
}