### Question:
StringComparator implements Comparator<String> { private StringComparator() { } private  StringComparator(); int compare( String string1, String string2 ); static final StringComparator INSTANCE; }### Answer:
@Test public void testStringComparator() { StringComparator comparator = StringComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( "", "" ) ); assertEquals( 0, comparator.compare( "abc", "abc" ) ); assertEquals( 1, comparator.compare( "", null ) ); assertEquals( 1, comparator.compare( "abc", "" ) ); assertEquals( 1, comparator.compare( "ac", "ab" ) ); assertEquals( 1, comparator.compare( "abc", "ab" ) ); assertEquals( -1, comparator.compare( null, "" ) ); assertEquals( -1, comparator.compare( "ab", "abc" ) ); assertEquals( -1, comparator.compare( "ab", "abc" ) ); }