code: public static int compareModifierVisibility(Element a, Element b) {
  
  
      // a better
      if (a.getModifiers().contains(Modifier.PUBLIC) && !b.getModifiers().contains(Modifier.PUBLIC)) {
        return -1;
      }
  
      if (isDefaultModifier(a.getModifiers()) && !isDefaultModifier(b.getModifiers())) {
        return -1;
      }
  
      if (a.getModifiers().contains(Modifier.PROTECTED) && !b.getModifiers().contains(Modifier.PROTECTED)) {
        return -1;
      }
  
  
      // b better
      if (b.getModifiers().contains(Modifier.PUBLIC) && !a.getModifiers().contains(Modifier.PUBLIC)) {
        return 1;
      }
  
      if (isDefaultModifier(b.getModifiers()) && !isDefaultModifier(a.getModifiers())) {
        return 1;
      }
  
      if (b.getModifiers().contains(Modifier.PROTECTED) && !a.getModifiers().contains(Modifier.PROTECTED)) {
        return 1;
      }
  
      // Same
      return 0;
    }
docs: Compare the modifier of two elements
  
  @return -1 if element a has better visibility, 0 if both have the same visibility, +1 if b has
  the better visibility. The "best" visibility is PUBLIC