### Question:
Configuration { public UsageThresholdConfiguration getHeapMemoryUsageThreshold() { return heapMemoryUsageThreshold; } Configuration(); List<String> getOverrides(); boolean isEnabled(); ExecutionFrequency getMaxFrequency(); String getHeapDumpName(); File getHeapDumpFolder(); Logger.Severity getLogLevel(); long getCheckIntervalInMillis(); UsageThresholdConfiguration getHeapMemoryUsageThreshold(); UsageThresholdConfiguration getCodeCacheMemoryUsageThreshold(); UsageThresholdConfiguration getMetaspaceMemoryUsageThreshold(); UsageThresholdConfiguration getPermGenMemoryUsageThreshold(); UsageThresholdConfiguration getCompressedClassSpaceMemoryUsageThreshold(); UsageThresholdConfiguration getCodeHeapNonNMethodsMemoryUsageThreshold(); UsageThresholdConfiguration getCodeHeapNonProfiledNMethodsMemoryUsageThreshold(); UsageThresholdConfiguration getCodeHeapProfiledNMethodsMemoryUsageThreshold(); UsageThresholdConfiguration getEdenSpaceMemoryUsageThreshold(); UsageThresholdConfiguration getSurvivorSpaceMemoryUsageThreshold(); UsageThresholdConfiguration getOldGenSpaceMemoryUsageThreshold(); UsageThresholdConfiguration getTenuredGenSpaceMemoryUsageThreshold(); String getExecuteBefore(); String getExecuteAfter(); String getExecuteOnShutDown(); String getCommandInterpreter(); static final Logger.Severity DEFAULT_LOG_LEVEL; static final String DEFAULT_NAME_PATTERN; }### Answer:
@Test public void testIncreaseOverTimeUsageThreshold() { temporarySystemProperties .set(Property.HEAP_MEMORY_USAGE_THRESHOLD.getQualifiedName()) .to("+90%/3h"); final Configuration configuration = Configuration.Builder.initializeFromSystemProperties(logger).build(); final IncreaseOverTimeFrameUsageThresholdConfiguration config = (IncreaseOverTimeFrameUsageThresholdConfiguration) configuration .getHeapMemoryUsageThreshold(); assertThat(config.getDelta(), is(90d)); assertThat(config.getTimeFrame(), is(3d)); assertThat(config.getTimeUnit(), is(IntervalTimeUnit.HOURS)); }
@Test public void testIncreaseOverTimeUsageThresholdDecimalDelta() { temporarySystemProperties .set(Property.HEAP_MEMORY_USAGE_THRESHOLD.getQualifiedName()) .to("+.4%/1s"); final Configuration configuration = Configuration.Builder.initializeFromSystemProperties(logger).build(); final IncreaseOverTimeFrameUsageThresholdConfiguration config = (IncreaseOverTimeFrameUsageThresholdConfiguration) configuration .getHeapMemoryUsageThreshold(); assertThat(config.getDelta(), is(0.4)); assertThat(config.getTimeFrame(), is(1d)); assertThat(config.getTimeUnit(), is(IntervalTimeUnit.SECONDS)); }