static String encodeBytes(BytesType bytesType) {
        byte[] value = bytesType.getValue();
        int length = value.length;
        int mod = length % MAX_BYTE_LENGTH;

        byte[] dest;
        if (mod != 0) {
            int padding = MAX_BYTE_LENGTH - mod;
            dest = new byte[length + padding];
            System.arraycopy(value, 0, dest, 0, length);
        } else {
            dest = value;
        }
        return Numeric.toHexStringNoPrefix(dest);
    }
@Test
    public void testStaticBytes() {
        Bytes staticBytes = new Bytes6(new byte[] {0, 1, 2, 3, 4, 5});
        assertEquals(
                TypeEncoder.encodeBytes(staticBytes),
                ("0001020304050000000000000000000000000000000000000000000000000000"));

        Bytes empty = new Bytes1(new byte[] {0});
        assertEquals(
                TypeEncoder.encodeBytes(empty),
                ("0000000000000000000000000000000000000000000000000000000000000000"));

        Bytes ones = new Bytes1(new byte[] {127});
        assertEquals(
                TypeEncoder.encodeBytes(ones),
                ("7f00000000000000000000000000000000000000000000000000000000000000"));

        Bytes dave = new Bytes4("dave".getBytes());
        assertEquals(
                TypeEncoder.encodeBytes(dave),
                ("6461766500000000000000000000000000000000000000000000000000000000"));
    }