@Test public void testSerDeserPerf2() throws Exception { Kryo kryo = new Kryo(); String outputPath = FilenameUtils.concat(getTmpPath(), "file2.bin"); Output output = new Output(new FileOutputStream(outputPath)); for (int i = 0; i < 1000; i++) { kryo.writeObject(output, constructNewPE()); } output.close(); Input input = new Input(new FileInputStream(outputPath)); NewPartitionedEvent someObject = kryo.readObject(input, NewPartitionedEvent.class); input.close(); Assert.assertTrue(someObject.getData().length == 1); }