### Question:
KMeansSpeedModel implements SpeedModel, Serializable { public ClusterInfo getCluster(int id) { return clusters.get(id); } KMeansSpeedModel(List<ClusterInfo> clusters); ClusterInfo getCluster(int id); void setCluster(int clusterID, ClusterInfo clusterInfo); ClusterInfo closestCluster(double[] vector); @Override float getFractionLoaded(); @Override String toString();  }### Answer:
@Test public void update() { List<ClusterInfo> clusters = new ArrayList<>(); clusters.add(new ClusterInfo(0, new double[]{-1.0, 2.0}, 2)); clusters.add(new ClusterInfo(1, new double[]{1.0, 3.0}, 3)); clusters.add(new ClusterInfo(2, new double[]{2.0, -1.0}, 4)); KMeansSpeedModel model = new KMeansSpeedModel(clusters); ClusterInfo cluster = model.getCluster(1); cluster.update(new double[]{-1.0,-1.0}, 3); assertEquals(1, cluster.getID()); assertEquals(6, cluster.getCount()); assertArrayEquals(new double[]{0.0,1.0}, cluster.getCenter()); }