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_UuidExperimentPercentage() {
    when(uuidSelector.getUuids()).thenReturn(Set.of(ACCOUNT_UUID));
    when(uuidSelector.getUuidEnrollmentPercentage()).thenReturn(0);
    assertFalse(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));
    when(uuidSelector.getUuidEnrollmentPercentage()).thenReturn(100);
    assertTrue(experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME));

    when(uuidSelector.getUuidEnrollmentPercentage()).thenReturn(75);
    final Map<Boolean, Long> counts = IntStream.range(0, 100).mapToObj(i -> {
          when(random.nextInt(100)).thenReturn(i);
          return experimentEnrollmentManager.isEnrolled(account.getUuid(), UUID_EXPERIMENT_NAME);
        })
        .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
    assertEquals(25, counts.get(false));
    assertEquals(75, counts.get(true));
  }