### Question:
ByteUtils { public static int isNegativeConstantTime(final int b) { return (b >> 8) & 1; } 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 isNegativeReturnsOneIfByteIsNegative() { MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(-1), IsEqual.equalTo(1)); MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(-100), IsEqual.equalTo(1)); MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(-255), IsEqual.equalTo(1)); }
@Test public void isNegativeReturnsZeroIfByteIsZeroOrPositive() { MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(0), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(1), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(32), IsEqual.equalTo(0)); MatcherAssert.assertThat(ByteUtils.isNegativeConstantTime(127), IsEqual.equalTo(0)); }