@Test
public void testToBytesPadded() {

    assertThat(Numeric.toBytesPadded(BigInteger.TEN, 1),
            is(new byte[]{0xa}));
    assertThat(Numeric.toBytesPadded(BigInteger.TEN, 8),
            is(new byte[]{0, 0, 0, 0, 0, 0, 0, 0xa}));
    assertThat(Numeric.toBytesPadded(BigInteger.valueOf(Integer.MAX_VALUE), 4),
            is(new byte[]{0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff}));
}