code: public Synset getLeastCommonSubsumer(Synset synset1, Synset synset2) {
          Preconditions.checkNotNull(synset1);
          Preconditions.checkNotNull(synset2);
  
          if (synset1.equals(synset2)) {
              return synset1;
          }
  
          List<Synset> path = shortestPath(synset1, synset2);
          if (path.isEmpty()) {
              return null;
          }
  
          int node1Height = synset1.depth();
          int node2Height = synset2.depth();
          int minHeight = Math.min(node1Height, node2Height);
          int maxHeight = Integer.MIN_VALUE;
          Synset lcs = null;
          for (Synset s : path) {
              if (s.equals(synset1) || s.equals(synset2)) {
                  continue;
              }
              int height = s.depth();
              if (height < minHeight && height > maxHeight) {
                  maxHeight = height;
                  lcs = s;
              }
          }
          if (lcs == null) {
              if (node1Height < node2Height) {
                  return synset1;
              }
              return synset2;
          }
          return lcs;
      }
docs: Gets the node that is least common subsumer (the synset with maximum height that is a parent to both nodes.)
  
  @param synset1 The first node
  @param synset2 The second node
  @return The least common subsumer or null