FastJsonSerialization implements Serialization { @Override public byte[] serializeMulti(Object[] data) throws IOException { return serialize(data); }  @Override byte[] serialize(Object data); @Override T deserialize(byte[] data, Class<T> clz); @Override byte[] serializeMulti(Object[] data); @Override Object[] deserializeMulti(byte[] data, Class<?>[] classes); @Override int getSerializationNumber();  }
@Test public void serializeMulti() throws Exception { UserAttentions userAttentions = new UserAttentions(); userAttentions.setUid(12312); Object[] params = new Object[]{userAttentions, 123, "xxx", false}; byte[] bytes = serialization.serializeMulti(params); Class[] classes = new Class[params.length]; for (int i = 0; i < params.length; i++) { classes[i] = params[i].getClass(); } Object[] result = serialization.deserializeMulti(bytes, classes); Assert.assertEquals(params.length, result.length); Assert.assertEquals(((UserAttentions) params[0]).getUid(), ((UserAttentions) result[0]).getUid()); for (int i = 1; i < params.length; i++) { Assert.assertEquals(params[i], result[i]); } }