### Question:
LongArrayComparator implements Comparator<long[]> { private LongArrayComparator() { } private  LongArrayComparator(); int compare( long[] longArray1, long[] longArray2 ); static final LongArrayComparator INSTANCE; }### Answer:
@Test public void testLongArrayComparator() { LongArrayComparator comparator = LongArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new long[] {}, new long[] {} ) ); assertEquals( 0, comparator.compare( new long[] { 1L, 2L }, new long[] { 1L, 2L } ) ); assertEquals( 1, comparator.compare( new long[] {}, null ) ); assertEquals( 1, comparator.compare( new long[] { 1L }, null ) ); assertEquals( 1, comparator.compare( new long[] { 1L, 2L }, new long[] { 1L, 1L } ) ); assertEquals( 1, comparator.compare( new long[] { 1L, 2L, 1L }, new long[] { 1L, 2L } ) ); assertEquals( 1, comparator.compare( new long[] { 1L, 2L }, new long[] { 1L, 1L, 2L } ) ); assertEquals( -1, comparator.compare( null, new long[] {} ) ); assertEquals( -1, comparator.compare( null, new long[] { 1L, 2L } ) ); assertEquals( -1, comparator.compare( null, new long[] { -1L, 2L } ) ); assertEquals( -1, comparator.compare( new long[] {}, new long[] { 1L, 2L } ) ); assertEquals( -1, comparator.compare( new long[] {}, new long[] { -1L, 2L } ) ); assertEquals( -1, comparator.compare( new long[] { -1L, 1L }, new long[] { 1L, 1L, 2L } ) ); long[] array = new long[3]; array[0] = 1L; array[1] = 2L; assertEquals( -1, comparator.compare( new long[] { 1L, 2L }, array ) ); }