LexicalComparator implements Comparator<Object> { @Override public int compare(Object obj1, Object obj2) { return collator.compare(obj1.toString(), obj2.toString()); } private  LexicalComparator(boolean casesensitive); private  LexicalComparator(Collator collator); @Override int compare(Object obj1, Object obj2); final static LexicalComparator CASE_SENSITIVE; final static LexicalComparator CASE_INSENSITIVE; }
@Test public void testIdentical() { testComparator(LexicalComparator.CASE_SENSITIVE.compare("FOOBAR", "FOOBAR"), 0, 1); }
@Test public void testCaseDifference() { testComparator(LexicalComparator.CASE_SENSITIVE.compare("FOOBAR", "FOoBAR"), 1, 0); }
@Test public void testSmallerThan() { testComparator(LexicalComparator.CASE_SENSITIVE.compare("FOOBAR", "FOOAR"), 1, 0); }
@Test public void testGreaterThan() { testComparator(LexicalComparator.CASE_SENSITIVE.compare("FOOAR", "FOOBAR"), -1, 0); }
@Test public void testIgnoreCase() { testComparator(LexicalComparator.CASE_INSENSITIVE.compare("FOOBAR", "FOoBAR"), 0, 1); }
@Test public void testGreaterThanIgnore() { testComparator(LexicalComparator.CASE_INSENSITIVE.compare("FOOaR", "FOOBAR"), -1, 0); }
@Test public void testSmallerThanIgnore() { testComparator(LexicalComparator.CASE_INSENSITIVE.compare("FOOBAR", "FOOBAR"), 0, 1); }