MetricsConverter { protected Metric toMetric(Meter.Id id, double value) { if (Double.isNaN(value)) { return null; } Map<String, String> tags = id.getTags().stream().collect(Collectors.toMap(Tag::getKey, Tag::getValue)); return new Metric(id.getName(), value, System.currentTimeMillis(), tags); }  abstract Stream<Metric> getMetrics(T meter); static TimeUnit getBaseTimeUnit();  }
@Test public void testToMetricWithNullValue() { Metric metric = converter.toMetric(ID, (0.0 / 0.0)); assertNull(metric); }