### Question:
BooleanComparator extends LdapComparator<String> { public int compare( String b1, String b2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13752_COMPARING_BOOLEAN, b1, b2 ) ); } if ( b1 == b2 ) { return 0; } if ( ( b1 == null ) || ( b2 == null ) ) { return b1 == null ? -1 : 1; } boolean boolean1 = Boolean.parseBoolean( b1 ); boolean boolean2 = Boolean.parseBoolean( b2 ); if ( boolean1 == boolean2 ) { return 0; } return boolean1 ? 1 : -1; } BooleanComparator( String oid ); int compare( String b1, String b2 );  }### Answer:
@Test public void testNullBooleans() { assertEquals( 0, comparator.compare( null, null ) ); assertEquals( -1, comparator.compare( null, "TRUE" ) ); assertEquals( -1, comparator.compare( null, "FALSE" ) ); assertEquals( 1, comparator.compare( "TRUE", null ) ); assertEquals( 1, comparator.compare( "FALSE", null ) ); }
@Test public void testBooleans() { assertEquals( 0, comparator.compare( "TRUE", "TRUE" ) ); assertEquals( 0, comparator.compare( "FALSE", "FALSE" ) ); assertEquals( -1, comparator.compare( "FALSE", "TRUE" ) ); assertEquals( 1, comparator.compare( "TRUE", "FALSE" ) ); String b1 = "TRUE"; String b2 = "true"; assertEquals( 0, comparator.compare( b1, Strings.upperCase( b2 ) ) ); }