### Question:
APISettings { static int checkPort(int port) { Preconditions.checkArgument(port > 0, "port must be positive: %s", port); return port; } private  APISettings(String host, int port, int securePort, Config config); static APISettings create(Config config); String getHost(); int getPort(); int getSecurePort(); boolean isSecure(); File getKeystoreFile(); String getKeystorePassword(); String getUserName(); String getPassword();  }### Answer:
@Test public void testPort() { int port = 1729; assertEquals(port, APISettings.checkPort(port)); }
@Test(expected = IllegalArgumentException.class) public void testInvalidPort() { APISettings.checkPort(0); }