public boolean matches(T other) {
        if (matchAny) {
            return true;
        } else if (other == null) {
            return negation ? value != null : value == null;
        } else {
            if (value instanceof byte[]) {
                boolean equal = Arrays.equals((byte[]) value, (byte[]) other);
                return negation ? !equal : equal;
            }
            return negation ? !Objects.equals(value, other) : Objects.equals(value, other);
        }
    }
@Test
    public void testMatches() {
        Match<String> m1 = Match.any();
        assertTrue(m1.matches(null));
        assertTrue(m1.matches("foo"));
        assertTrue(m1.matches("bar"));

        Match<String> m2 = Match.ifNull();
        assertTrue(m2.matches(null));
        assertFalse(m2.matches("foo"));

        Match<String> m3 = Match.ifValue("foo");
        assertFalse(m3.matches(null));
        assertFalse(m3.matches("bar"));
        assertTrue(m3.matches("foo"));

        Match<byte[]> m4 = Match.ifValue(new byte[8]);
        assertTrue(m4.matches(new byte[8]));
        assertFalse(m4.matches(new byte[7]));
    }