Profile { public static void registerDefaultProfile(Class<?> cls, Function<Strategy, Strategy> profile) { registerProfile(cls, DEFAULT, profile); }  static void registerDefaultProfile(Class<?> cls, Function<Strategy, Strategy> profile); static void registerProfile(Class<?> cls, String name, Function<Strategy, Strategy> profile); static Optional<Function<Strategy, Strategy>> getDefaultProfile(Class<?> cls); static Optional<Function<Strategy, Strategy>> getProfile(Class<?> cls, String name);  }
@Test(expected = IllegalArgumentException.class) public void testReRegistrationThrowsException() { Profile.registerDefaultProfile(Scope1.class, s -> s.withExamples(1)); Profile.registerDefaultProfile(Scope1.class, s -> s.withExamples(1)); }
@Test public void propertyCanLoadRegisteredProperties() { int numExamples = 4; AtomicInteger examplesRun = new AtomicInteger(0); Profile.registerDefaultProfile(Scope1.class, s -> s.withExamples(numExamples)); qt().withRegisteredProfiles(Scope1.class).forAll(integers().all()).check(i -> { examplesRun.incrementAndGet(); return true; }); assertThat(examplesRun.get()).isEqualTo(numExamples); }