    @Test
    public void testToBytes() throws Exception {

        CustomOperation customOperation1 = new CustomOperation(fee, payer, operationId, requiredAuths, shortData);
        byte[] serialized1 = customOperation1.toBytes();
        assertArrayEquals(EXPECTED_SERIALIZED_BYTES_1, serialized1);

        // test with some long data string to check if data length is serialized correctly
        CustomOperation customOperation2 = new CustomOperation(fee, payer, operationId, requiredAuths, longData);
        byte[] serialized2 = customOperation2.toBytes();
        assertArrayEquals(EXPECTED_SERIALIZED_BYTES_2, serialized2);
    }