docs: @Nullable
    public static ModifiersTree getModifiers(Tree tree) {
      if (tree instanceof ClassTree) {
        return ((ClassTree) tree).getModifiers();
      } else if (tree instanceof MethodTree) {
        return ((MethodTree) tree).getModifiers();
      } else if (tree instanceof VariableTree) {
        return ((VariableTree) tree).getModifiers();
      } else {
        return null;
      }
    }