public void testKryoSerialization() throws Exception {
StringKeyedVector skv = buildSKV();
// Serialize to a byte array in ram.
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Output ko = new Output(bos);
Kryo kry = new Kryo();
kry.writeObject(ko, skv);
ko.flush();
// Deserialize.
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
Input ki = new Input(bis);
StringKeyedVector des = (StringKeyedVector)kry.readObject(ki,
StringKeyedVector.class);
assertFalse(des.getFreezeKeySet());
assertEquals(2, des.size());
assertEquals(1.0, des.getCoordinate("foo"), eps);
assertEquals(-2.0, des.getCoordinate("bar"), eps);