public boolean isEnrolled(final UUID accountUuid, final String experimentName) {

    final Optional<DynamicExperimentEnrollmentConfiguration> maybeConfiguration = dynamicConfigurationManager
        .getConfiguration().getExperimentEnrollmentConfiguration(experimentName);

    return maybeConfiguration.map(config -> {

      if (config.getUuidSelector().getUuids().contains(accountUuid)) {
        final int r = random.nextInt(100);
        return r < config.getUuidSelector().getUuidEnrollmentPercentage();
      }

      return isEnrolled(accountUuid, config.getEnrollmentPercentage(), experimentName);

    }).orElse(false);
  }
@Test
  void testIsEnrolled_UuidExperiment() {
    assertFalse(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));
    assertFalse(
        experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME + "-unrelated-experiment"));

    when(uuidSelector.getUuids()).thenReturn(Set.of(ACCOUNT_UUID));
    assertTrue(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));

    when(uuidSelector.getUuids()).thenReturn(Collections.emptySet());
    when(experimentEnrollmentConfiguration.getEnrollmentPercentage()).thenReturn(0);

    assertFalse(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));

    when(experimentEnrollmentConfiguration.getEnrollmentPercentage()).thenReturn(100);
    assertTrue(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));
  }