code: private SortedSet<String> mergeSets(SortedSet<String> primary, Set<String> secondary) {
      SortedSet<String> result = primary;
      if (!secondary.isEmpty()) {
        result = new TreeSet<>();
        result.addAll(primary);
        result.addAll(secondary);
      }
      return result;
    }
docs: Merge two sets. If secondary set is empty return primary.
  @param primary Primary set
  @param secondary Secondary set
  @return Merged set