### Question:
TypeEncoder { static String encodeNumeric(NumericType numericType) { byte[] rawValue = toByteArray(numericType); byte paddingValue = getPaddingValue(numericType); byte[] paddedRawValue = new byte[Type.MAX_BYTE_LENGTH]; if (paddingValue != 0) { for (int i = 0; i < paddedRawValue.length; i++) { paddedRawValue[i] = paddingValue; } } System.arraycopy( rawValue, 0, paddedRawValue, Type.MAX_BYTE_LENGTH - rawValue.length, rawValue.length); return Numeric.toHexStringNoPrefix(paddedRawValue); } private  TypeEncoder(); @SuppressWarnings("unchecked") static String encode(Type parameter);  }### Answer:
@Test public void testUintEncode() { Uint zero = new Uint64(BigInteger.ZERO); assertThat(TypeEncoder.encodeNumeric(zero), is("0000000000000000000000000000000000000000000000000000000000000000")); Uint maxLong = new Uint64(BigInteger.valueOf(Long.MAX_VALUE)); assertThat(TypeEncoder.encodeNumeric(maxLong), is("0000000000000000000000000000000000000000000000007fffffffffffffff")); Uint maxValue = new Uint( new BigInteger("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)); assertThat(TypeEncoder.encodeNumeric(maxValue), is("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); Uint largeValue = new Uint( new BigInteger("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", 16)); assertThat(TypeEncoder.encodeNumeric(largeValue), is("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe")); }
@Test public void testIntEncode() { Int zero = new Int64(BigInteger.ZERO); assertThat(TypeEncoder.encodeNumeric(zero), is("0000000000000000000000000000000000000000000000000000000000000000")); Int maxLong = new Int64(BigInteger.valueOf(Long.MAX_VALUE)); assertThat(TypeEncoder.encodeNumeric(maxLong), is("0000000000000000000000000000000000000000000000007fffffffffffffff")); Int minLong = new Int64(BigInteger.valueOf(Long.MIN_VALUE)); assertThat(TypeEncoder.encodeNumeric(minLong), is("ffffffffffffffffffffffffffffffffffffffffffffffff8000000000000000")); Int minusOne = new Int(BigInteger.valueOf(-1)); assertThat(TypeEncoder.encodeNumeric(minusOne), is("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); }