### Question:
RawBits { static int compare( long lhsRawBits, byte lhsType, long rhsRawBits, byte rhsType ) { if ( lhsType == BYTE || lhsType == SHORT || lhsType == INT || lhsType == LONG ) { return compareLongAgainstRawType( lhsRawBits, rhsRawBits, rhsType ); } else if ( lhsType == FLOAT ) { double lhsFloat = Float.intBitsToFloat( (int) lhsRawBits ); return compareDoubleAgainstRawType( lhsFloat, rhsRawBits, rhsType ); } else if ( lhsType == DOUBLE ) { double lhsDouble = Double.longBitsToDouble( lhsRawBits ); return compareDoubleAgainstRawType( lhsDouble, rhsRawBits, rhsType ); } return Long.compare( lhsRawBits, rhsRawBits ); }    }### Answer:
@Test public void shouldHaveSameCompareResultsAsValueCompare() { List<Value> values = asValueObjects( objects ); List<NumberIndexKey> numberIndexKeys = asNumberIndexKeys( values ); for ( int i = 0; i < values.size(); i++ ) { Value value1 = values.get( i ); NumberIndexKey numberIndexKey1 = numberIndexKeys.get( i ); for ( int j = 0; j < values.size(); j++ ) { Value value2 = values.get( j ); NumberIndexKey numberIndexKey2 = numberIndexKeys.get( j ); assertEquals( Values.COMPARATOR.compare( value1, value2 ), layout.compare( numberIndexKey1, numberIndexKey2 ) ); assertEquals( Values.COMPARATOR.compare( value2, value1 ), layout.compare( numberIndexKey2, numberIndexKey1 ) ); } } }