### Question:
CassandraConfigurationFileImpl implements CassandraConfiguration { @Override public int maxRetries() { int value = iniFile.getIntValue(CASSANDRA_WRITE_RETRIES, DEFAULT_CASSANDRA_WRITE_RETRIES); Preconditions.checkState(value > 0, "Negative or null write retries value in " + CONFIG_FILE_PATH + " configuration file"); return value; } @VisibleForTesting  CassandraConfigurationFileImpl(IniFile iniFile); @Override Collection<String> seeds(); @Override String keyspace(); @Override String user(); @Override String password(); @Override int readTimeoutMs(); @Override CassandraRetryPolicy retryPolicy(); @Override int maxRetries();  }### Answer:
@Test public void maxRetriesDefaultValue() { expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_WRITE_RETRIES, 3)) .andReturn(3); control.replay(); int maxRetries = new CassandraConfigurationFileImpl(iniFile).maxRetries(); control.verify(); assertThat(maxRetries).isEqualTo(3); }
@Test(expected=IllegalStateException.class) public void maxRetriesZero() { expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_WRITE_RETRIES, 3)) .andReturn(0); control.replay(); try { new CassandraConfigurationFileImpl(iniFile).maxRetries(); } finally { control.verify(); } }
@Test(expected=IllegalStateException.class) public void maxRetriesNegative() { expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_WRITE_RETRIES, 3)) .andReturn(-1); control.replay(); try { new CassandraConfigurationFileImpl(iniFile).maxRetries(); } finally { control.verify(); } }
@Test public void maxRetriesRetries() { int expectedMaxRetries = 3; expect(iniFile.getIntValue(CassandraConfigurationFileImpl.CASSANDRA_WRITE_RETRIES, 3)) .andReturn(expectedMaxRetries); control.replay(); int maxRetries = new CassandraConfigurationFileImpl(iniFile).maxRetries(); control.verify(); assertThat(maxRetries).isEqualTo(expectedMaxRetries); }