@Test
    public void test_creation_of_proxy_classes() {
        List<Long> memoryUsageRecordInMebibytes = new ArrayList<>(NUMBER_OF_RUNS / PROBE_INTERVAL);
        for (int i = 0; i < NUMBER_OF_RUNS; i++) {
            ScenarioBase scenario = new ScenarioBase();
            TestStage testStage = scenario.addStage(TestStage.class);
            testStage.something();
            if (i % PROBE_INTERVAL == 0) {
                System.gc();
                long usedMemory = calculateMemoryUsageRoundedDownToMebibytes();
                memoryUsageRecordInMebibytes.add(usedMemory);
            }
        }
        List<Long> growth = calculateChangeInMemoryConsumption(memoryUsageRecordInMebibytes);
        double averageConsumptionChange = average(growth);
        assertThat(averageConsumptionChange)
                .as("There is no net increase of memory consumption "
                        + "for the continued creation and discarding of proxy classes.")
                .isLessThanOrEqualTo(GROWTH_EXPECTED_IF_LAST_REPORTED_GROWTH_IS_POSITIVE);
    }
test that the continued creation of proxy classes does not
constantly consume memory.
jgiven-core/src/test/java/com/tngtech/jgiven/impl/ProxyClassPerformanceTest.java