### Question:
KMeans { public boolean iteration() { if (this.clusters.size() == 0) { throw new AIFHError("Must call one of the init methods first."); } final boolean done = assignmentStep(); if (!done) { updateStep(); } return done; } KMeans(final int theK); void initRandom(final List<BasicData> theObservations); void initForgy(final List<BasicData> theObservations); Cluster findNearestCluster(final double[] observation); boolean iteration(); int iteration(final int maxIterations); GenerateRandom getRandomGeneration(); void setRandomGeneration(final GenerateRandom randomGeneration); CalculateDistance getDistanceMetric(); void setDistanceMetric(final CalculateDistance distanceMetric); int getK(); List<Cluster> getClusters();  }### Answer:
@Test(expected = AIFHError.class) public void testEarlyIteration() { final KMeans kmeans = new KMeans(3); kmeans.iteration(); }