Calc { public static int compareInt(byte[] v1, byte[] v2) { return compareInt(v1, 0, v2, 0); }  static byte[] fromBigDecimal(BigDecimal i); static BigDecimal toBigDecimal(byte[] b); static BigDecimal toBigDecimal(byte[] b, int off, int len); static BigInteger toBigInteger(byte[] b); static BigInteger toBigInteger(byte[] b, int off, int len); static byte[] fromBigInteger(BigInteger i); static void fromBigInteger(BigInteger i, byte[] b, int off); static String toString(byte[] s); static String toString(byte[] s, int off, int len); static byte[] fromString(String s); static void fromString(String s, byte[] b, int off); static int toUIntVar(byte[] b); static int toInt(byte[] b, int off, int len); static byte[] fromUIntVar(int i); static int toInt(byte[] b); static int toInt(byte[] b, int off); static byte[] fromInt(int i); static void fromInt(int i, byte[] b, int off); static long toLong(byte[] b); static long toLong(byte[] b, int off); static byte[] fromLong(long i); static void fromLong(long i, byte[] b, int off); static double toDouble(byte[] b); static double toDouble(byte[] b, int off); static byte[] fromDouble(double i); static void fromDouble(double i, byte[] b, int off); static float toFloat(byte[] b); static float toFloat(byte[] b, int off); static byte[] fromFloat(float i); static void fromDouble(float i, byte[] b, int off); static int compare(byte[] v1, byte[] v2); static int compare(byte[] v1, int off1, int len1, byte[] v2, int off2, int len2); final static int compareAsPrefix(byte[] v1, byte[] v2); static int compareU(byte[] v1, byte[] v2); static int compareU(byte[] v1, int off1, int len1, byte[] v2, int off2, int len2); final static int compareUAsPrefix(byte[] v1, byte[] v2); static int compareUIntVar(byte[] v1, byte[] v2); static int compareInt(byte[] v1, byte[] v2); static int compareInt(byte[] v1, int off1, byte[] v2, int off2); static int compareLong(byte[] v1, byte[] v2); static int compareLong(byte[] v1, int off1, byte[] v2, int off2); static int compareDouble(byte[] v1, byte[] v2); static int compareFloat(byte[] v1, byte[] v2); static int compareBigInteger(byte[] v1, byte[] v2); static int compareBigDecimal(byte[] v1, byte[] v2);  }
@Test public void compareInt(){ byte[] value1 = new byte[]{1, 1, 1, 1}; byte[] value2 = new byte[]{1, 1, 1, 2,}; assertEquals("The second value should be 1 larger than the first", -1, Calc.compareInt(value1, value2)); }