@Override
    public int compare(Optional<String> a, Optional<String> b) {
        if (!a.isPresent()) {
            if (!b.isPresent()) {
                return 0;
            } else {
                return -1;
            }
        } else if (!b.isPresent()) {
            return 1;
        }
        return a.get().compareTo(b.get());
    }
@Test
    public void testComparisons() {
        assertEquals(0, INSTANCE.compare(Optional.of("foo"), Optional.of("foo")));
        assertEquals(-1, INSTANCE.compare(Optional.of("a"), Optional.of("b")));
        assertEquals(1, INSTANCE.compare(Optional.of("b"), Optional.of("a")));
        assertEquals(-1, INSTANCE.compare(Optional.empty(), Optional.of("a")));
        assertEquals(1, INSTANCE.compare(Optional.of("a"), Optional.empty()));
        assertEquals(0, INSTANCE.compare(Optional.empty(), Optional.empty()));
    }