### Question:
AppConfig extends AbstractConfig { public synchronized boolean hasApiServerPort() { int port = getApiServerPort(); return NetUtils.isValidPort(port); } AppConfig(Path file); synchronized int getApiServerPort(); synchronized boolean hasApiServerPort(); synchronized void setApiServerPort(final int port); synchronized boolean isTrayNotificationEnabled(); synchronized void setTrayNotification(boolean enabled);  }### Answer:
@Test public void testHasApiServerPort() throws IOException { appConfig.setApiServerPort(0); assertFalse(appConfig.hasApiServerPort()); appConfig.setApiServerPort(-1); assertFalse(appConfig.hasApiServerPort()); appConfig.setApiServerPort(65536); assertFalse(appConfig.hasApiServerPort()); appConfig.setApiServerPort(1); assertTrue(appConfig.hasApiServerPort()); appConfig.setApiServerPort(47325); assertTrue(appConfig.hasApiServerPort()); appConfig.setApiServerPort(65535); assertTrue(appConfig.hasApiServerPort()); }