### Question:
Port { public static Port parseProtocol(int port, String protocolString) { String protocol = UDP_PROTOCOL.equalsIgnoreCase(protocolString) ? UDP_PROTOCOL : TCP_PROTOCOL; return new Port(port, protocol); } private  Port(int port, String protocol); static Port tcp(int port); static Port udp(int port); static Port parseProtocol(int port, String protocolString); int getPort(); String getProtocol(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testParseProtocol() { Assert.assertEquals(Port.tcp(1111), Port.parseProtocol(1111, "tcp")); Assert.assertEquals(Port.udp(2222), Port.parseProtocol(2222, "udp")); Assert.assertEquals(Port.tcp(3333), Port.parseProtocol(3333, "")); }