### Question:
TreeDataIndex { public double[] featuresInSortedOrder(int k, int featureId) { return features[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();  }### Answer:
@Test public void featuresInSortedOrderTest() { 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++) assertArrayEquals(featuresInSortedOrder[k][featureId], idx.featuresInSortedOrder(k, featureId), 0.01); } }