@Test
public void testGetLabelCode() {

    Map<Double, Integer> encoder = new HashMap<>();
    encoder.put(0.0, 0);
    encoder.put(1.0, 1);
    encoder.put(2.0, 2);
    GiniImpurityMeasureCalculator calculator = new GiniImpurityMeasureCalculator(encoder, useIdx);
    assertEquals(0, calculator.getLabelCode(0.0));
    assertEquals(1, calculator.getLabelCode(1.0));
    assertEquals(2, calculator.getLabelCode(2.0));
}