Configuration { public void setDefaultFalsePositiveProbability(double defaultFalsePositiveProbability) { if (defaultFalsePositiveProbability <= 0 || defaultFalsePositiveProbability >= 1) { throw new IllegalArgumentException("defaultFalsePositiveProbability: " + defaultFalsePositiveProbability + " (expected between 0 and 1 exclusive)"); } this.defaultFalsePositiveProbability = defaultFalsePositiveProbability; } Configuration(); void setMetricsPrefix(String metricsPrefix); @JsonSetter("purgeFilterIntervalMillis") void setPurgeFilterInterval(int purgeFilterIntervalMillis); void setMaxHttpConnections(int maxHttpConnections); void setMaxHttpRequestLength(int maxHttpRequestLength); void setMaxWorkerThreadPoolSize(int maxWorkerThreadPoolSize); @JsonSetter("requestTimeoutSeconds") void setRequestTimeout(int requestTimeoutSeconds); void setIdleTimeoutMillis(int idleTimeoutMillis); void setDefaultExpectedInsertions(int defaultExpectedInsertions); void setDefaultFalsePositiveProbability(double defaultFalsePositiveProbability); @JsonSetter("defaultValidSecondsAfterCreate") void setDefaultValidPeriodAfterCreate(long defaultValidSecondsAfterCreate); void setChannelBufferSizeForFilterPersistence(int channelBufferSizeForFilterPersistence); void setPersistentStorageDirectory(@Nullable String persistentStorageDirectory); void setAllowRecoverFromCorruptedPersistentFile(boolean allowRecoverFromCorruptedPersistentFile); void setChannelOptions(SupportedChannelOptions channelOptions); @JsonProperty("triggerPersistenceCriteria") void setPersistenceCriteria(@Nullable List<TriggerPersistenceCriteria> criteriaList); void setGracefulShutdownQuietPeriodMillis(long gracefulShutdownQuietPeriodMillis); void setGracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis);  }
@Test public void testSetDefaultFalsePositiveProbability() { final Configuration c = new Configuration(); assertThatThrownBy(() -> c.setDefaultFalsePositiveProbability(-1.0)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("defaultFalsePositiveProbability: -1.0 (expected between 0 and 1 exclusive)"); assertThatThrownBy(() -> c.setDefaultFalsePositiveProbability(0)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("defaultFalsePositiveProbability: 0.0 (expected between 0 and 1 exclusive)"); assertThatThrownBy(() -> c.setDefaultFalsePositiveProbability(1)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("defaultFalsePositiveProbability: 1.0 (expected between 0 and 1 exclusive)"); assertThatThrownBy(() -> c.setDefaultFalsePositiveProbability(1.1)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("defaultFalsePositiveProbability: 1.1 (expected between 0 and 1 exclusive)"); }