CircuitInterface implements Serializable { public Port getPort(String portName) { Validate.notNull(portName, "Port name can't be null"); for (Port p : ports) { if (StringUtils.equalsIgnoreCase(p.getName(), portName)) { return p; } } return null; } CircuitInterface();  CircuitInterface(String name);  CircuitInterface(String name, Port port); String getName(); void setName(String name); boolean isName(String circuitName); void addAll(List<Port> collection); void add(Port port); Port getPort(String portName); List<Port> getPorts(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void getPortNullArgument() { ci.getPort(null); }
@Test public void getPort() { String portName = "port_name"; assertNull(ci.getPort(portName)); Port port = new Port(portName, PortDirection.IN); ci.add(port); assertEquals(port, ci.getPort(portName)); assertEquals(port, ci.getPort(portName.toUpperCase())); }