### Question:
ByteUtils { public static int isEqualConstantTime(final int b, final int c) { int result = 0; final int xor = b ^ c; for (int i = 0; i < 8; i++) { result |= xor >> i; } return (result ^ 0x01) & 0x01; } private  ByteUtils(); static byte[] bigIntToByteArrayLeadingZeros(final BigInteger value, final int numBytes); static byte[] byteArrayLeadingZeros(byte[] valueByteArray, int numBytes); static byte[] bigIntToBytes(final BigInteger x); static byte[] longToBytes(final long x); static int bytesToInt(final byte[] bytes); static byte[] intToBytes(final int x); static byte[] shortToBytes(final short x); static int isEqualConstantTime(final int b, final int c); static int isNegativeConstantTime(final int b); static String toString(final byte[] bytes);  }### Answer:
@Test public void isEqualReturnsOneIfBytesAreEqual() { MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(0, 0), IsEqual.equalTo(1)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(7, 7), IsEqual.equalTo(1)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(64, 64), IsEqual.equalTo(1)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(255, 255), IsEqual.equalTo(1)); }
@Test public void isEqualReturnsOneIfLoBytesAreEqualButHiBytesAreNot() { MatcherAssert.assertThat( ByteUtils.isEqualConstantTime(75 + 256, 75 + 256 * 2), IsEqual.equalTo(1)); }
@Test public void isEqualReturnsZeroIfBytesAreNotEqual() { MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(0, 1), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(7, -7), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(64, 63), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isEqualConstantTime(254, 255), IsEqual.equalTo(0)); }