ServerSettingsWrapper { public final void saveSettings() { try { FileOutputStream out = new FileOutputStream(propFile); properties.store(out, null); out.close(); } catch (IOException ex) { System.err.println("Unable to save settings file. Old values will be used on next start"); ex.printStackTrace(); } } ServerSettingsWrapper(File propFile); final void setServerPort(TankSelector tank, int port); final int getServerPort(TankSelector tank, int defaultPort); final void saveSettings();  }
@Test public void testSaveSettings() throws IOException { wrapper.setServerPort(TankSelector.valuesWithoutMix()[0], 1122); wrapper.saveSettings(); wrapper = new ServerSettingsWrapper(tempTestFile); assertEquals(1122, wrapper.getServerPort(TankSelector.valuesWithoutMix()[0], -1)); }