### Question:
InstanceUtils { public static boolean isMissing(final Instance instance, final int index) { return Double.isNaN(instance.getValue(index)); } 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 testIsMissing() { final int nonTargetIndex = (this.schema.getTargetIndex().get() + 1) % this.schema.getFieldSchemas().size(); final double[] fieldValues = fieldValues(index -> index); final MockInstance instanceNotMissing = new MockInstance(fieldValues); assertThat(InstanceUtils.isMissing(instanceNotMissing, nonTargetIndex)) .as("Check when there is a value present") .isFalse(); fieldValues[nonTargetIndex] = Double.NaN; final MockInstance instanceMissing = new MockInstance(fieldValues); assertThat(InstanceUtils.isMissing(instanceMissing, nonTargetIndex)) .as("Check when the value is missing") .isTrue(); }