class DialogFileFilter extends javax.swing.filechooser.FileFilter {

    private String description;
    private final List<String> extensions;

    public DialogFileFilter(String description) {
        if (description == null) {
            Logger.getLogger(DialogFileFilter.class.getName())
                .throwing(getClass().getName(), "constructor", new NullPointerException("Description cannot be null."));
        }
        this.description = description;
        this.extensions = new ArrayList<>();
    }

    @Override
    public boolean accept(File file) {<FILL_FUNCTION_BODY>}

    @Override
    public String getDescription() {
        StringBuffer buffer = new StringBuffer(description);
        buffer.append(" (");
        for (String extension : extensions) {
            buffer.append("*" + extension).append(" ");
        }
        buffer.deleteCharAt(buffer.length() - 1);
        return buffer.append(")").toString();
    }


    public void setDescription(String description) {
        if (description == null) {
            Logger.getLogger(DialogFileFilter.class.getName()).throwing(getClass().getName(), "setDescription",
                new NullPointerException("Description cannot be null."));
        }
        this.description = description;
    }


    public void addExtension(String extension) {
        if (extension == null) {
            Logger.getLogger(DialogFileFilter.class.getName()).throwing(getClass().getName(), "addExtension",
                new NullPointerException("Description cannot be null."));
        }
        extensions.add(extension);
    }

    public void addExtensions(String[] extension) {
        if (extension == null) {
            Logger.getLogger(DialogFileFilter.class.getName()).throwing(getClass().getName(), "addExtensions",
                new NullPointerException("Description cannot be null."));
        }
        for (int i = 0; i < extension.length; i++) {
            extensions.add(extension[i]);
        }
    }

    public void removeExtension(String extension) {
        extensions.remove(extension);
    }


    public void clearExtensions() {
        extensions.clear();
    }


    public List<String> getExtensions() {
        return extensions;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DialogFileFilter other = (DialogFileFilter) obj;
        if (!Objects.equals(this.description, other.description)) {
            return false;
        }
        return Objects.equals(this.extensions, other.extensions);
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 43 * hash + Objects.hashCode(this.description);
        hash = 43 * hash + Objects.hashCode(this.extensions);
        return hash;
    }

    //TODO define hashCode
}

        if (file.isDirectory() || extensions.isEmpty()) {
            return true;
        }
        String fileName = file.getName().toLowerCase();
        for (String extension : extensions) {
            if (fileName.endsWith(extension)) {
                return true;
            }
        }
        return false;
    
<methods>public abstract boolean accept(java.io.File) ,public abstract java.lang.String getDescription() <variables>