UInt32 implements UInt<UInt32> { @Override public byte[] toByteArray() { return ByteAndBitConverter.toByteArray(value); } UInt32(int value); @Override UInt32 add(UInt32 other); @Override UInt32 multiply(UInt32 other); @Override UInt32 subtract(UInt32 other); @Override UInt32 negateUInt(); @Override boolean isZero(); @Override int getBitLength(); @Override byte[] toByteArray(); @Override BigInteger toBigInteger(); @Override long toLong(); @Override int toInt(); @Override String toString();  }
@Test public void toByteArray() { byte[] expected = new byte[left.getBitLength() / Byte.SIZE]; expected[expected.length - 1] = 42; Assert.assertArrayEquals(expected, left.toByteArray()); }