### Question:
BatchPredictorExample implements Predictor<Integer, Float> { @Override public CompletionStage<List<Prediction<Integer, Float>>> predict( final ScheduledExecutorService scheduler, final Duration timeout, final Integer... input) { return predictorBuilder.predictor().predict(scheduler, timeout, input); } BatchPredictorExample(); @Override CompletionStage<List<Prediction<Integer, Float>>> predict(
      final ScheduledExecutorService scheduler, final Duration timeout, final Integer... input);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testCustomMetrics() throws InterruptedException, ExecutionException, TimeoutException { final BatchPredictorExample example = new BatchPredictorExample(); final Integer[] batch = new Integer[] {3, 1, -4, -42, 42, -10}; final List<Float> predictions = example .predict(batch) .toCompletableFuture() .join() .stream() .map(Prediction::value) .collect(Collectors.toList()); final List<Float> expected = Arrays.stream(batch).map(v -> (float) v / 10 * 2).collect(Collectors.toList()); assertThat(predictions, is(expected)); }