Code example for TreeSet

0
  public static String printModifiers(Set<Modifier> allModifiers) {
    if (allModifiers.isEmpty()) {
      return ""; 
    } 
 
    SortedSet<Modifier> sorted = new TreeSet<>(allModifiers);
    return Joiner.on(" ").join(sorted) + " ";
  } 
} 
Connect your IDE to all the code out there  Get Codota for Java