### Question:
AES { public static byte[] encryptByCTR(byte[] data, byte[] key, byte[] iv) { return doAES(data, key, iv, Cipher.ENCRYPT_MODE, AESType.CTR, "PKCS5Padding"); }  static byte[] encryptByCTR(byte[] data, byte[] key, byte[] iv); static byte[] decryptByCTR(byte[] ciphertext, byte[] key, byte[] iv); static byte[] encryptByCBC(byte[] data, byte[] key, byte[] iv); static byte[] decryptByCBC(byte[] ciphertext, byte[] key, byte[] iv); static byte[] encryptByCTRNoPadding(byte[] data, byte[] key, byte[] iv); static byte[] decryptByCTRNoPadding(byte[] ciphertext, byte[] key, byte[] iv); static byte[] encryptByCBCNoPadding(byte[] data, byte[] key, byte[] iv); static byte[] decryptByCBCNoPadding(byte[] ciphertext, byte[] key, byte[] iv);  }### Answer:
@Test public void doCTREncrypt() { for (String[] example : CTRExample) { byte[] encrypt = AES.encryptByCTR(NumericUtil.hexToBytes(example[1]), NumericUtil.hexToBytes(example[2]), NumericUtil.hexToBytes(example[3])); assertEquals(example[0], NumericUtil.bytesToHex(encrypt)); } }