### Question:
ForwarderSwitch extends NetworkDevice { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("ForwarderSwitch<id="); builder.append(getIdentifier()); builder.append(", connected="); builder.append(connectedTo); builder.append(", routing: "); for (int i = 0; i < destinationToNextSwitch.length; i++) { if (i != 0) { builder.append(", "); } builder.append(i); builder.append("->"); builder.append(destinationToNextSwitch[i]); } builder.append(">"); return builder.toString(); } ForwarderSwitch(int identifier, TransportLayer transportLayer, int n, Intermediary intermediary); @Override void receive(Packet genericPacket); @Override void receiveFromIntermediary(Packet genericPacket); @Override String toString();  }### Answer:
@Test public void testToString() { ForwarderSwitch device = new ForwarderSwitch(3, null, 5, new IdentityFlowletIntermediary()); device.addConnection(topology.getPort(3, 1)); device.addConnection(topology.getPort(3, 4)); device.setDestinationToNextSwitch(0, 1); device.setDestinationToNextSwitch(1, 1); device.setDestinationToNextSwitch(2, 4); device.setDestinationToNextSwitch(4, 4); assertNotNull(device.toString()); }