public class SerializeUtilTest {
@Test
public void test_measurepoint_save(){
Kryo kryo = SerializeUtil.createKryo();
Output output = new Output(66666);
kryo.writeClassAndObject(output, new MeasurePointData("1111"));
int oldPos = output.position();
kryo.writeClassAndObject(output, new MeasurePointData("1111"));
assertEquals(oldPos+19,output.position());//only key is written not string again
kryo.writeClassAndObject(output, new MeasurePointData("1111"));
kryo.writeClassAndObject(output, new MeasurePointData("2222"));
kryo.writeClassAndObject(output, new MeasurePointData("2222"));
kryo.writeClassAndObject(output, new MeasurePointData("1111"));
Input input = new Input(output.getBuffer());
assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
}