Use the chi-square labels as integers
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestUtils.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestUtils.java
index 7e93238..05fa6f0 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestUtils.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestUtils.java
@@ -155,10 +155,10 @@
* @param observed observed counts
* @param alpha significance level of the test
*/
- public static void assertChiSquareAccept(String[] valueLabels,
- double[] expected,
- long[] observed,
- double alpha) {
+ private static void assertChiSquare(int[] valueLabels,
+ double[] expected,
+ long[] observed,
+ double alpha) {
final ChiSquareTest chiSquareTest = new ChiSquareTest();
// Fail if we can reject null hypothesis that distributions are the same
@@ -200,11 +200,7 @@
double[] expected,
long[] observed,
double alpha) {
- final String[] labels = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- labels[i] = Integer.toString(values[i]);
- }
- assertChiSquareAccept(labels, expected, observed, alpha);
+ assertChiSquare(values, expected, observed, alpha);
}
/**
@@ -218,11 +214,11 @@
public static void assertChiSquareAccept(double[] expected,
long[] observed,
double alpha) {
- final String[] labels = new String[expected.length];
- for (int i = 0; i < labels.length; i++) {
- labels[i] = Integer.toString(i + 1);
+ final int[] values = new int[expected.length];
+ for (int i = 0; i < values.length; i++) {
+ values[i] = i + 1;
}
- assertChiSquareAccept(labels, expected, observed, alpha);
+ assertChiSquare(values, expected, observed, alpha);
}
/**