def METHOD_NAME(self, other):
    """
    The equals method.
    :param other: a different object.
    :type other: object
    :return: True if equal, otherwise False.
    :rtype: bool
    """
    if not isinstance(other, ASTCompoundStmt):
        return False
    if self.get_for_stmt() is not None and other.get_for_stmt() is not None and \
            not self.get_for_stmt().METHOD_NAME(other.get_for_stmt()):
        return False
    if self.get_while_stmt() is not None and other.get_while_stmt() is not None and \
            not self.get_while_stmt().METHOD_NAME(other.get_while_stmt()):
        return False
    if self.get_if_stmt() is not None and other.get_if_stmt() is not None and \
            not self.get_if_stmt().METHOD_NAME(other.get_if_stmt()):
        return False
    return True