### Question:
OpushConfigurationImpl implements OpushConfiguration { @Override public Optional<Integer> maxWindowSize() { return Optional.fromNullable(iniFile.getIntegerValue(MAX_WINDOW_SIZE, null)); } @VisibleForTesting protected  OpushConfigurationImpl(IniFile opushConfigurationFile, String applicationName); @Override Charset getDefaultEncoding(); @Override String getDataDirectory(); @Override int transactionTimeoutInSeconds(); @Override ResourceBundle getResourceBundle(Locale locale); @Override String getGlobalDomain(); @Override String getActiveSyncServletUrl(); @Override boolean isRequestLoggerEnabled(); @Override String getObmSyncBaseUrl(String obmSyncHost); @Override String getObmSyncServicesUrl(String obmSyncHost); @Override int defaultWindowSize(); @Override Optional<Integer> maxWindowSize();  }### Answer:
@Test public void maxWindowSizeShouldBeAbsentWhenNone() { expect(iniFile.getIntegerValue(MAX_WINDOW_SIZE, null)) .andReturn(null); control.replay(); Optional<Integer> maxWindowSize = opushConfigurationImpl.maxWindowSize(); control.verify(); assertThat(maxWindowSize).isAbsent(); }
@Test public void maxWindowSizeShouldBePresentWhenGiven() { int expectedMaxWindowSize = 100; expect(iniFile.getIntegerValue(MAX_WINDOW_SIZE, null)) .andReturn(expectedMaxWindowSize); control.replay(); Optional<Integer> maxWindowSize = opushConfigurationImpl.maxWindowSize(); control.verify(); assertThat(maxWindowSize).isPresent(); assertThat(maxWindowSize.get()).isEqualTo(expectedMaxWindowSize); }