@Test void isValidShouldReturnFalseWhenZero() { assertThat(Port.isValid(0)) .isFalse(); }
public static boolean isValid(int port) { return VALID_PORT_RANGE.contains(port); }
Port { public static boolean isValid(int port) { return VALID_PORT_RANGE.contains(port); } }
Port { public static boolean isValid(int port) { return VALID_PORT_RANGE.contains(port); } Port(int value); }
Port { public static boolean isValid(int port) { return VALID_PORT_RANGE.contains(port); } Port(int value); static Port of(int portNumber); static int generateValidUnprivilegedPort(); static void assertValid(int port); static boolean isValid(int port); int getValue(); @Override final boolean equals(Object o); @Override final int hashCode(); }
Port { public static boolean isValid(int port) { return VALID_PORT_RANGE.contains(port); } Port(int value); static Port of(int portNumber); static int generateValidUnprivilegedPort(); static void assertValid(int port); static boolean isValid(int port); int getValue(); @Override final boolean equals(Object o); @Override final int hashCode(); static final int MAX_PORT_VALUE; static final int PRIVILEGED_PORT_BOUND; }