### Question:
BasicPbCodec { public static byte[] encodeBytesList(byte[]... elements){ if(elements == null){ return null; } BaseProto.BaseBytesList.Builder builder = BaseProto.BaseBytesList.newBuilder(); for(byte[] element : elements){ builder.addBytesListData(ByteString.copyFrom(element)); } return builder.build().toByteArray(); }  static byte[] encodeBytesList(byte[]... elements); static byte[] encodeBytesList(List<ByteArrayWrapper> bytesList); static List<ByteArrayWrapper> decodeBytesList(byte[] protoBuf); static byte[] encodeInt(int data); static int decodeInt(byte[] protoBuf); static byte[] encodeLong(long data); static long decodeLong(byte[] protoBuf); static byte[] encodeString(String data); static String decodeString(byte[] protoBuf);  }### Answer:
@Test public void encodeBytesList() throws InvalidProtocolBufferException { byte[] result = BasicPbCodec.encodeBytesList(bytes0,bytes1,bytes2); List<ByteArrayWrapper> bytesList = new ArrayList<>(); bytesList.add(new ByteArrayWrapper(bytes0)); bytesList.add(new ByteArrayWrapper(bytes1)); bytesList.add(new ByteArrayWrapper(bytes2)); List<ByteArrayWrapper> decodeList = BasicPbCodec.decodeBytesList(result); for(int i=0;i<decodeList.size();i++){ Assert.assertEquals(bytesList.get(i),bytesList.get(i)); } byte[] result1 = BasicPbCodec.encodeBytesList(bytesList); Assert.assertArrayEquals(result,result1); }