InstanceConfig { @Nonnull public InstanceConfig setBackupCount(int newBackupCount) { checkBackupCount(newBackupCount, 0); this.backupCount = newBackupCount; return this; }  @Nonnull InstanceConfig setCooperativeThreadCount(int size); int getCooperativeThreadCount(); @Nonnull InstanceConfig setFlowControlPeriodMs(int flowControlPeriodMs); int getFlowControlPeriodMs(); @Nonnull InstanceConfig setBackupCount(int newBackupCount); int getBackupCount(); InstanceConfig setScaleUpDelayMillis(long millis); long getScaleUpDelayMillis(); boolean isLosslessRestartEnabled(); InstanceConfig setLosslessRestartEnabled(boolean enabled); static final int DEFAULT_FLOW_CONTROL_PERIOD_MS; static final int DEFAULT_BACKUP_COUNT; }
@Test public void when_NegativeBackupCount_thenThrowsException() { InstanceConfig instanceConfig = new InstanceConfig(); expectedException.expect(IllegalArgumentException.class); instanceConfig.setBackupCount(-1); }
@Test public void when_TooBigBackupCount_thenThrowsException() { InstanceConfig instanceConfig = new InstanceConfig(); expectedException.expect(IllegalArgumentException.class); instanceConfig.setBackupCount(10); }