assertSame("measure", dist.getMeasure().getClass(), dist1.getMeasure().getClass());
}
@Test
public void testDMClusterDistribution2() {
DistanceMeasureClusterDistribution dist =
new DistanceMeasureClusterDistribution(new VectorWritable(new DenseVector(2)), new EuclideanDistanceMeasure());
String json = dist.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(ModelDistribution.class, new JsonModelDistributionAdapter());
builder.registerTypeAdapter(DistanceMeasure.class, new JsonDistanceMeasureAdapter());
Gson gson = builder.create();
DistanceMeasureClusterDistribution dist1 = (DistanceMeasureClusterDistribution) gson
.fromJson(json, AbstractVectorModelDistribution.MODEL_DISTRIBUTION_TYPE);
assertSame("prototype", dist.getModelPrototype().getClass(), dist1.getModelPrototype().getClass());
assertSame("measure", dist.getMeasure().getClass(), dist1.getMeasure().getClass());
}