### Question:
CustomMetricsExample 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); } CustomMetricsExample(final SemanticMetricRegistry metricRegistry, final MetricId metricId); @Override CompletionStage<List<Prediction<Integer, Float>>> predict(
      final ScheduledExecutorService scheduler, final Duration timeout, final Integer... input);  }### Answer:
@Test public void testCustomMetrics() throws InterruptedException, ExecutionException, TimeoutException { final SemanticMetricRegistry registry = new SemanticMetricRegistry(); final MetricId metricId = MetricId.build().tagged("service", "my-application"); final CustomMetricsExample example = new CustomMetricsExample(registry, metricId); example.predict(3, 1, -4, -42, 42, -10).toCompletableFuture().join(); registry.getCounters().values().forEach(counter -> Assert.assertEquals(3, counter.getCount())); }