code: public List<Link> getConnectedLinks(PhysicalElement pe) {
          List<Link> myLinks = new ArrayList<>();
          for (Link l : this.links) {
              if (l.getElement().equals(pe)) {
                  myLinks.add(l);
              } else if (l.getSwitch().equals(pe)) {
                  myLinks.add(l);
              }
          }
          return myLinks;
      }
docs: Get the list of links connected to a given physical element
  
  @param pe    the physical element
  @return the list of links