public MetricConsumer newInstance() {
        if (factories.length == 1) {
            return factories[0].newInstance();
        }
        MetricConsumer[] consumers = new MetricConsumer[factories.length];
        for (int i = 0; i < factories.length; ++i) {
            consumers[i] = factories[i].newInstance();
        }
        return new ForwardingMetricConsumer(consumers);
    }
@Test
    void requireThatSingleConsumerIsNotDelegated() {
        MetricConsumer consumer = Mockito.mock(MetricConsumer.class);
        MetricConsumerProvider provider = MetricConsumerProviders.newSingletonFactories(consumer);
        assertSame(consumer, provider.newInstance());
    }