ServerSettingsWrapper { public final int getServerPort(TankSelector tank, int defaultPort) { String port = properties.getProperty("serverPort_" + tank.name()); if (port == null) { return defaultPort; } try { return Integer.parseInt(port); } catch (NumberFormatException e) { return defaultPort; } } ServerSettingsWrapper(File propFile); final void setServerPort(TankSelector tank, int port); final int getServerPort(TankSelector tank, int defaultPort); final void saveSettings();  }
@Test public void testGetServerPort() { int result = wrapper.getServerPort(TankSelector.valuesWithoutMix()[0], -1); assertEquals(1000, result); }
@Test public void testGetServerPortNull() { int result = wrapper.getServerPort(TankSelector.valuesWithoutMix()[1], -1); assertEquals(-1, result); }