code: public void connectDevice(Device device) throws ShanksException {
          if (this.linkedDevices.size() < deviceCapacity) {
              if (!this.linkedDevices.contains(device)) {
                  this.linkedDevices.add(device);
                  device.connectToLink(this);
                  logger.finer("Link " + this.getID() + " has Device "
                          + device.getID() + " in its linked device list.");
              } else {
                  logger.finer("Link " + this.getID() + " already has Device "
                          + device.getID() + " in its linked device list.");
              }
          } else {
              if (!this.linkedDevices.contains(device)) {
                  logger.warning("Link " + this.getID()
                          + " is full of its capacity. Device " + device.getID()
                          + " was not included in its linked device list.");
                  throw new TooManyConnectionException(this);
              } else {
                  logger.finer("Link " + this.getID() + " already has Device "
                          + device.getID() + " in its linked device list.");
              }
          }
      }
docs: Connect a device to the link
  
  @param device
  @throws TooManyConnectionException