public class ByteComparatorTest
{
@Test
public void testByteComparator()
{
ByteComparator comparator = new ByteComparator();
assertEquals( 0, comparator.compare( null, null ) );
assertEquals( 0, comparator.compare( ( byte ) 0x00, ( byte ) 0x00 ) );
assertEquals( 0, comparator.compare( ( byte ) 0xFE, ( byte ) 0xFE ) );
assertEquals( 1, comparator.compare( ( byte ) 0x01, null ) );
assertEquals( 1, comparator.compare( ( byte ) 0x01, ( byte ) 0x00 ) );
assertEquals( 1, comparator.compare( ( byte ) 0x00, ( byte ) 0xFF ) );
assertEquals( 1, comparator.compare( ( byte ) 0x7F, ( byte ) 0x01 ) );
assertEquals( -1, comparator.compare( null, ( byte ) 0x00 ) );
assertEquals( -1, comparator.compare( null, ( byte ) 0xFF ) );
assertEquals( -1, comparator.compare( ( byte ) 0x00, ( byte ) 0x01 ) );
assertEquals( -1, comparator.compare( ( byte ) 0xF0, ( byte ) 0xFF ) );
assertEquals( -1, comparator.compare( ( byte ) 0xFF, ( byte ) 0x01 ) );
}