class Comment extends Node {

    private String content;

    @InternalProperty
    private Node commentedNode;

    @AllFieldsConstructor
    public Comment(String content) {
        this(null, content);
    }

    /**
     * This constructor is used by the parser and is considered private.
     */
    @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
    public Comment(TokenRange tokenRange, String content) {
        super(tokenRange);
        setContent(content);
        customInitialization();
    }

    /**
     * Return the text of the comment.
     *
     * @return text of the comment
     */
    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public String getContent() {
        return content;
    }

    /**
     * Sets the text of the comment.
     *
     * @param content the text of the comment to set
     */
    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public Comment setContent(final String content) {
        assertNotNull(content);
        if (content == this.content) {
            return this;
        }
        notifyPropertyChange(ObservableProperty.CONTENT, this.content, content);
        this.content = content;
        return this;
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isLineComment() {
        return false;
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public LineComment asLineComment() {
        throw new IllegalStateException(f("%s is not LineComment, it is %s", this, this.getClass().getSimpleName()));
    }

    public Optional<Node> getCommentedNode() {
        return Optional.ofNullable(this.commentedNode);
    }

    /**
     * Sets the commentedNode
     *
     * @param commentedNode the commentedNode, can be null
     * @return this, the Comment
     */
    public Comment setCommentedNode(Node commentedNode) {<FILL_FUNCTION_BODY>}

    public boolean isOrphan() {
        return this.commentedNode == null;
    }

    @Override
    public Node setComment(final Comment comment) {
        // comments on comments are not allowed, so we override setComment(Comment) here
        if (comment != null) {
            throw new IllegalArgumentException("A comment cannot be commented.");
        }
        return super.setComment(comment);
    }

    @Override
    public boolean remove() {

        if (this.commentedNode != null) {
            this.commentedNode.setComment(null);
            return true;
        }
            if (this.getParentNode().isPresent()) {
            return this.getParentNode().get().removeOrphanComment(this);
        }
        return false;
    }

    @Override
    public Node findRootNode() {
        // (Non-orphan) comments are not integrated into the normal AST; we need to get the commented node first.
        Node n = getCommentedNode().orElse(this);
        while (n.getParentNode().isPresent()) {
            n = n.getParentNode().get();
        }
        return n;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
    public Comment clone() {
        return (Comment) accept(new CloneVisitor(), null);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
    public CommentMetaModel getMetaModel() {
        return JavaParserMetaModel.commentMetaModel;
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isBlockComment() {
        return false;
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public BlockComment asBlockComment() {
        throw new IllegalStateException(f("%s is not BlockComment, it is %s", this, this.getClass().getSimpleName()));
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isJavadocComment() {
        return false;
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public JavadocComment asJavadocComment() {
        throw new IllegalStateException(f("%s is not JavadocComment, it is %s", this, this.getClass().getSimpleName()));
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifBlockComment(Consumer<BlockComment> action) {
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifJavadocComment(Consumer<JavadocComment> action) {
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifLineComment(Consumer<LineComment> action) {
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<BlockComment> toBlockComment() {
        return Optional.empty();
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<JavadocComment> toJavadocComment() {
        return Optional.empty();
    }

    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<LineComment> toLineComment() {
        return Optional.empty();
    }
    
    /*
     * Header is "//" for line comment 
     */
    abstract public String getHeader(); 
    
    /*
     * 
     */
    abstract public String getFooter();
    
    /*
     * Returns the content of the comment with header and footer
     */
    public String asString() {
    	return getHeader()+getContent()+getFooter();
    }
}

        notifyPropertyChange(ObservableProperty.COMMENTED_NODE, this.commentedNode, commentedNode);
        if (commentedNode == null) {
            this.commentedNode = null;
            return this;
        }
        if (commentedNode == this) {
            throw new IllegalArgumentException();
        }
        if (commentedNode instanceof Comment) {
            throw new IllegalArgumentException();
        }
        this.commentedNode = commentedNode;
        return this;
    
<methods>public void addOrphanComment(com.github.javaparser.ast.comments.Comment) ,public com.github.javaparser.ast.Node clone() ,public boolean containsData(DataKey<?>) ,public boolean equals(java.lang.Object) ,public List<T> findAll(Class<T>) ,public List<T> findAll(Class<T>, com.github.javaparser.ast.Node.TreeTraversal) ,public List<T> findAll(Class<T>, Predicate<T>) ,public Optional<com.github.javaparser.ast.Node> findByRange(com.github.javaparser.Range) ,public Optional<com.github.javaparser.ast.CompilationUnit> findCompilationUnit() ,public Optional<M> findData(DataKey<M>) ,public Optional<T> findFirst(com.github.javaparser.ast.Node.TreeTraversal, Function<com.github.javaparser.ast.Node,Optional<T>>) ,public Optional<N> findFirst(Class<N>) ,public Optional<N> findFirst(Class<N>, Predicate<N>) ,public com.github.javaparser.ast.Node findRootNode() ,public List<com.github.javaparser.ast.comments.Comment> getAllContainedComments() ,public List<com.github.javaparser.ast.Node> getChildNodes() ,public List<N> getChildNodesByType(Class<N>) ,public Optional<com.github.javaparser.ast.comments.Comment> getComment() ,public M getData(DataKey<M>) ,public Set<DataKey<?>> getDataKeys() ,public com.github.javaparser.utils.LineSeparator getLineEndingStyle() ,public com.github.javaparser.utils.LineSeparator getLineEndingStyleOrDefault(com.github.javaparser.utils.LineSeparator) ,public com.github.javaparser.metamodel.NodeMetaModel getMetaModel() ,public List<N> getNodesByType(Class<N>) ,public List<com.github.javaparser.ast.comments.Comment> getOrphanComments() ,public Optional<com.github.javaparser.ast.Node> getParentNode() ,public com.github.javaparser.ast.Node getParentNodeForChildren() ,public com.github.javaparser.ast.Node.Parsedness getParsed() ,public Optional<com.github.javaparser.Range> getRange() ,public com.github.javaparser.resolution.SymbolResolver getSymbolResolver() ,public Optional<com.github.javaparser.TokenRange> getTokenRange() ,public boolean hasScope() ,public final int hashCode() ,public boolean isAncestorOf(com.github.javaparser.ast.Node) ,public boolean isPhantom() ,public boolean isRegistered(com.github.javaparser.ast.observer.AstObserver) ,public void notifyPropertyChange(com.github.javaparser.ast.observer.ObservableProperty, P, P) ,public void register(com.github.javaparser.ast.observer.AstObserver) ,public void register(com.github.javaparser.ast.observer.AstObserver, com.github.javaparser.ast.Node.ObserverRegistrationMode) ,public void registerForSubtree(com.github.javaparser.ast.observer.AstObserver) ,public boolean remove() ,public boolean remove(com.github.javaparser.ast.Node) ,public com.github.javaparser.ast.Node removeComment() ,public void removeData(DataKey<?>) ,public void removeForced() ,public boolean removeOrphanComment(com.github.javaparser.ast.comments.Comment) ,public boolean replace(com.github.javaparser.ast.Node) ,public boolean replace(com.github.javaparser.ast.Node, com.github.javaparser.ast.Node) ,public final com.github.javaparser.ast.Node setBlockComment(java.lang.String) ,public com.github.javaparser.ast.Node setComment(com.github.javaparser.ast.comments.Comment) ,public void setData(DataKey<M>, M) ,public final com.github.javaparser.ast.Node setLineComment(java.lang.String) ,public com.github.javaparser.ast.Node setParentNode(com.github.javaparser.ast.Node) ,public com.github.javaparser.ast.Node setParsed(com.github.javaparser.ast.Node.Parsedness) ,public com.github.javaparser.ast.Node setRange(com.github.javaparser.Range) ,public com.github.javaparser.ast.Node setTokenRange(com.github.javaparser.TokenRange) ,public Stream<com.github.javaparser.ast.Node> stream(com.github.javaparser.ast.Node.TreeTraversal) ,public Stream<com.github.javaparser.ast.Node> stream() ,public final java.lang.String toString() ,public final java.lang.String toString(com.github.javaparser.printer.configuration.PrinterConfiguration) ,public void tryAddImportToParentCompilationUnit(Class<?>) ,public void unregister(com.github.javaparser.ast.observer.AstObserver) ,public void walk(com.github.javaparser.ast.Node.TreeTraversal, Consumer<com.github.javaparser.ast.Node>) ,public void walk(Consumer<com.github.javaparser.ast.Node>) ,public void walk(Class<T>, Consumer<T>) <variables>public static final int ABSOLUTE_BEGIN_LINE,public static final int ABSOLUTE_END_LINE,private static final int LEVELS_TO_EXPLORE,public static final DataKey<com.github.javaparser.utils.LineSeparator> LINE_SEPARATOR_KEY,public static Comparator<NodeWithRange<?>> NODE_BY_BEGIN_POSITION,protected static final DataKey<java.lang.Boolean> PHANTOM_KEY,protected static final DataKey<com.github.javaparser.printer.Printer> PRINTER_KEY,public static final DataKey<com.github.javaparser.resolution.SymbolResolver> SYMBOL_RESOLVER_KEY,private ArrayList<com.github.javaparser.ast.Node> childNodes,private com.github.javaparser.ast.comments.Comment comment,private IdentityHashMap<DataKey<?>,java.lang.Object> data,private ArrayList<com.github.javaparser.ast.observer.AstObserver> observers,private ArrayList<com.github.javaparser.ast.comments.Comment> orphanComments,private com.github.javaparser.ast.Node parentNode,private com.github.javaparser.ast.Node.Parsedness parsed,protected static final com.github.javaparser.printer.configuration.PrinterConfiguration prettyPrinterNoCommentsConfiguration,private com.github.javaparser.Range range,private com.github.javaparser.TokenRange tokenRange