### Question:
InstanceUtils { public static boolean isMissingClass(final Instance instance, final DatasetSchema schema) { return getClassValue(instance, schema) .map(value -> Double.isNaN(value)) .orElse(true); } private  InstanceUtils(); static Optional<Double> getClassValue(final Instance instance, final DatasetSchema schema); static boolean isMissingClass(final Instance instance, final DatasetSchema schema); static boolean isMissing(final Instance instance, final int index);  }### Answer:
@Test public void testIsMissingClass() { final double[] fieldValues = fieldValues(index -> index); final MockInstance instanceNotMissing = new MockInstance(fieldValues); assertThat(InstanceUtils.isMissingClass(instanceNotMissing, this.schema)) .as("Check when the class is present") .isFalse(); fieldValues[this.schema.getTargetIndex().get()] = Double.NaN; final MockInstance instanceMissing = new MockInstance(fieldValues); assertThat(InstanceUtils.isMissingClass(instanceMissing, this.schema)) .as("Check when the class is missing") .isTrue(); }