Code example for Set

Methods: isEmpty

0
 
import javax.lang.model.element.Modifier; 
 
class Modifiers { 
  public static String printModifiers(Set<Modifier> allModifiers) {
    if (allModifiers.isEmpty()) {
      return ""; 
    } 
 
    SortedSet<Modifier> sorted = new TreeSet<>(allModifiers);
    return Joiner.on(" ").join(sorted) + " ";
  } 
}