TreeDataIndex { public double labelInSortedOrder(int k, int featureId) { return labels[idx[k][featureId]]; } TreeDataIndex(double[][] features, double[] labels); private  TreeDataIndex(int[][] idxProj, double[][] features, double[] labels); double labelInSortedOrder(int k, int featureId); double[] featuresInSortedOrder(int k, int featureId); double featureInSortedOrder(int k, int featureId); TreeDataIndex filter(TreeFilter filter); int rowsCount(); int columnsCount();  }
@Test public void labelInSortedOrderTest() { assertEquals(features.length, idx.rowsCount()); assertEquals(features[0].length, idx.columnsCount()); for (int k = 0; k < idx.rowsCount(); k++) { for (int featureId = 0; featureId < idx.columnsCount(); featureId++) assertEquals(labelsInSortedOrder[k][featureId], idx.labelInSortedOrder(k, featureId), 0.01); } }