public String getComment(String path) {
        Preconditions.checkNotNull(path, "Path cannot be null");

        Configuration root = getRoot();
        if (root == null) {
            throw new IllegalStateException("Cannot access section without a root");
        }

        // Return the comment associated to this element.
        if (path.length() == 0) {
            return this.getParent() == null ? null : this.getParent().getComment(this.getName());
        }


        final char separator = root.options().pathSeparator();
        // i1 is the leading (higher) index
        // i2 is the trailing (lower) index
        int i1 = -1, i2;
        ConfigurationSection section = this;
        while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) {
            section = section.getConfigurationSection(path.substring(i2, i1));
            if (section == null) {
                return null;
            }
        }

        String key = path.substring(i2);
        if (section == this) {
            return comments.get(key);
        }
        return section.getComment(key);
    }