@Test public void testMaxOfSigned() { assertThat(maxOfSigned(1), is(BigInteger.valueOf(Byte.MAX_VALUE))); assertThat(maxOfSigned(2), is(BigInteger.valueOf(Short.MAX_VALUE))); assertThat(maxOfSigned(4), is(BigInteger.valueOf(Integer.MAX_VALUE))); assertThat(maxOfSigned(8), is(BigInteger.valueOf(Long.MAX_VALUE))); assertThat(maxOfSigned(16), is(new BigInteger("+7fffffffffffffffffffffffffffffff", 16))); }
public static BigInteger maxOfSigned(int size) { return new BigInteger("+7f" + StringUtils.repeat("ff", size - 1), 16); }
BigIntegerUtils { public static BigInteger maxOfSigned(int size) { return new BigInteger("+7f" + StringUtils.repeat("ff", size - 1), 16); } }
BigIntegerUtils { public static BigInteger maxOfSigned(int size) { return new BigInteger("+7f" + StringUtils.repeat("ff", size - 1), 16); } private  BigIntegerUtils(); }
BigIntegerUtils { public static BigInteger maxOfSigned(int size) { return new BigInteger("+7f" + StringUtils.repeat("ff", size - 1), 16); } private  BigIntegerUtils(); static byte[] toLittleEndian(BigInteger integer, int sizeInBytes); static BigInteger asSignedLittleEndian(byte[] bytes); static BigInteger asUnsignedLittleEndian(byte[] bytes); static BigInteger minOfSigned(int size); static BigInteger maxOfSigned(int size); static BigInteger maxOfUnsigned(int size); static String toHexString(BigInteger integer, int size); }
BigIntegerUtils { public static BigInteger maxOfSigned(int size) { return new BigInteger("+7f" + StringUtils.repeat("ff", size - 1), 16); } private  BigIntegerUtils(); static byte[] toLittleEndian(BigInteger integer, int sizeInBytes); static BigInteger asSignedLittleEndian(byte[] bytes); static BigInteger asUnsignedLittleEndian(byte[] bytes); static BigInteger minOfSigned(int size); static BigInteger maxOfSigned(int size); static BigInteger maxOfUnsigned(int size); static String toHexString(BigInteger integer, int size);  }