@SafeVarargs
    @PublicAPI(usage = ACCESS)
    public static <T> MetricsComponents<T> of(MetricsComponent<T>... components) {
        return of(ImmutableSet.copyOf(components));
    }
@Test
    public void rejects_components_with_non_unique_identifier() {
        assertThatThrownBy(() ->
                MetricsComponents.of(
                        MetricsComponent.of("duplicate-key"),
                        MetricsComponent.of("duplicate-key"))
        )
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessageContaining("Multiple entries with same key")
                .hasMessageContaining("duplicate-key");
    }