### Question:
CsnSidComparator extends LdapComparator<String> { public int compare( String sidStr1, String sidStr2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13744_COMPARING_CSN_SID, sidStr1, sidStr2 ) ); } if ( sidStr1 == null ) { return ( sidStr2 == null ) ? 0 : -1; } if ( sidStr2 == null ) { return 1; } int sid1 = 0; int sid2; try { sid1 = Integer.parseInt( sidStr1, 16 ); } catch ( NumberFormatException nfe ) { return -1; } try { sid2 = Integer.parseInt( sidStr2, 16 ); } catch ( NumberFormatException nfe ) { return 1; } if ( sid1 > sid2 ) { return 1; } else if ( sid2 > sid1 ) { return -1; } return 0; } CsnSidComparator( String oid ); int compare( String sidStr1, String sidStr2 );  }### Answer:
@Test public void testNullSids() { assertEquals( 0, comparator.compare( null, null ) ); assertEquals( -1, comparator.compare( null, "000" ) ); assertEquals( 1, comparator.compare( "000", null ) ); }
@Test public void testEqualsSids() { assertEquals( 0, comparator.compare( "000", "000" ) ); assertEquals( 0, comparator.compare( "000", "0" ) ); assertEquals( 0, comparator.compare( "fff", "fff" ) ); }
@Test public void testDifferentSids() { assertEquals( -1, comparator.compare( "123", "456" ) ); assertEquals( 1, comparator.compare( "FFF", "000" ) ); assertEquals( 1, comparator.compare( "FFF", "GGG" ) ); }