public static Set<Metric> mapFromDataProvider(TelemetryDataProvider<?> provider) {
    switch (provider.getDimension()) {
      case INSTALLATION -> {
        return mapInstallationMetric(provider);
      } case PROJECT -> {
        return mapProjectMetric(provider);
      } case USER -> {
        return mapUserMetric(provider);
      } case LANGUAGE -> {
        return mapLanguageMetric(provider);
      } default -> throw new IllegalArgumentException("Dimension: " + provider.getDimension() + " not yet implemented.");
    }
  }
@Test
  void mapFromDataProvider_whenAdhocInstallationProviderWithValue_shouldMapToMetric() {
    TestTelemetryAdhocBean provider = new TestTelemetryAdhocBean(Dimension.INSTALLATION, true); // Force the value to be returned

    Set<Metric> metrics = TelemetryMetricsMapper.mapFromDataProvider(provider);
    List<InstallationMetric> userMetrics = retrieveList(metrics);

    assertThat(userMetrics)
      .extracting(InstallationMetric::getKey, InstallationMetric::getType, InstallationMetric::getValue, InstallationMetric::getGranularity)
      .containsExactlyInAnyOrder(
        tuple("telemetry-adhoc-bean", TelemetryDataType.BOOLEAN, true, Granularity.ADHOC)
      );
  }