@Test
public void testClusterObservationsSerialization() throws Exception {
double[] data = { 1.1, 2.2, 3.3 };
Vector vector = new DenseVector(data);
ClusterObservations reference = new ClusterObservations(1, 2.0, vector, vector);
DataOutputBuffer out = new DataOutputBuffer();
reference.write(out);
ClusterObservations info = new ClusterObservations();
DataInputBuffer in = new DataInputBuffer();
in.reset(out.getData(), out.getLength());
info.readFields(in);
assertEquals("probability", reference.getS0(), info.getS0(), EPSILON);
assertEquals("point total", reference.getS1(), info.getS1());
assertEquals("combiner", reference.getCombinerState(), info.getCombinerState());
}