### Question:
Classification { private boolean checkJenksDataValidity() { final int[] tabNbreClass = new int[dataLength]; double currentVal; int nbreSameElmt; for (int idCurrentVal = 0; idCurrentVal < dataLength; idCurrentVal++) { currentVal = data[idCurrentVal]; nbreSameElmt = 1; for (int idtest = 0; idtest < dataLength; idtest++) { if (currentVal == data[idtest] && idCurrentVal != idtest) nbreSameElmt++; } tabNbreClass[nbreSameElmt]++; } int nbreClassMax = 0; for (int i = 1; i<dataLength; i++) { nbreClassMax += tabNbreClass[i]/i; if (nbreClassMax >= classNumber) return true; } return false; } Classification(); void computeQuantile(); void computeJenks(); void computeJenks(boolean checkData); List<double[]> getClasses(); int[] getIndex(); void setData(double ...data); void setClassNumber(int classNumber);  }### Answer:
@Test public void checkJenksDataValidityTest() { data = new double[]{1, 1, 1, 2, 2, 3, 4}; classification.setData(data); classification.setClassNumber(4); try { classification.computeJenks(); } catch(Exception e) { fail("test should had execute"); } classification.setClassNumber(5); try { classification.computeJenks(); fail("test should had failed"); } catch(Exception e) { } }