code: private <S extends StaticSlot, R extends StaticRef> StaticRef findBestDeclToAdd(
        StaticSymbolTable<S, R> otherSymbolTable, S slot) {
      StaticRef decl = slot.getDeclaration();
      if (isGoodRefToAdd(decl)) {
        return decl;
      }
  
      for (R ref : otherSymbolTable.getReferences(slot)) {
        if (isGoodRefToAdd(ref)) {
          return ref;
        }
      }
  
      return null;
    }
docs: Helper for addSymbolsFrom, to determine the best declaration spot.