### Question:
BooleanArrayComparator implements Comparator<boolean[]> { private BooleanArrayComparator() { } private  BooleanArrayComparator(); int compare( boolean[] booleanArray1, boolean[] booleanArray2 ); static final BooleanArrayComparator INSTANCE; }### Answer:
@Test public void testBooleanArrayComparator() { BooleanArrayComparator comparator = BooleanArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); boolean[] b1 = new boolean[] { true, true, true }; boolean[] b2 = new boolean[] { true, true, false }; boolean[] b3 = new boolean[] { true, false, true }; boolean[] b4 = new boolean[] { false, true, true }; boolean[] b5 = new boolean[] { true, true }; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new boolean[] {}, new boolean[] {} ) ); assertEquals( 0, comparator.compare( b1, b1 ) ); assertEquals( -1, comparator.compare( null, new boolean[] {} ) ); assertEquals( -1, comparator.compare( null, b1 ) ); assertEquals( -1, comparator.compare( new boolean[] {}, b1 ) ); assertEquals( -1, comparator.compare( new boolean[] {}, b4 ) ); assertEquals( -1, comparator.compare( b5, b1 ) ); assertEquals( -1, comparator.compare( b5, b3 ) ); assertEquals( 1, comparator.compare( new boolean[] {}, null ) ); assertEquals( 1, comparator.compare( b1, null ) ); assertEquals( 1, comparator.compare( b1, new boolean[] {} ) ); assertEquals( 1, comparator.compare( b1, b2 ) ); assertEquals( 1, comparator.compare( b1, b3 ) ); assertEquals( 1, comparator.compare( b1, b4 ) ); assertEquals( 1, comparator.compare( b1, b5 ) ); }