@Test
public void testPositiveToByteArray() {

  final Object[][] testParameters = new Object[][] {
      {null, new byte[0]},
      {BigInteger.valueOf(0L), new byte[] {(byte) 0x00}},
      {BigInteger.valueOf(127L), new byte[] {(byte) 0x7F}},
      {BigInteger.valueOf(255L), new byte[] {(byte) 0xFF}}
  };
  for (final Object[] testParameter : testParameters) {
    final BigInteger value = (BigInteger) testParameter[0];
    final byte[] expected = (byte[]) testParameter[1];
    final byte[] actual = NumberUtils.positiveToByteArray(value);
    assertTrue(Arrays.equals(expected, actual));
  }
}