@Test public void testEqualsObject() { FileChooserFilter filter2 = new FileChooserFilter(description, extension); assertFalse(filter.equals(filter2)); }
@Override public boolean equals(final Object other) { if (!(other instanceof FileChooserFilter)) return false; final FileChooserFilter otherFilter = (FileChooserFilter) other; if (!otherFilter.description.equals(description)) return false; if (otherFilter.extensions.length != extensions.length) return false; Arrays.sort(otherFilter.extensions); Arrays.sort(extensions); for (int i = 0; i < extensions.length; ++i) { if (!extensions[i].equals(otherFilter.extensions[i])) return false; } return true; }
FileChooserFilter extends FileFilter { @Override public boolean equals(final Object other) { if (!(other instanceof FileChooserFilter)) return false; final FileChooserFilter otherFilter = (FileChooserFilter) other; if (!otherFilter.description.equals(description)) return false; if (otherFilter.extensions.length != extensions.length) return false; Arrays.sort(otherFilter.extensions); Arrays.sort(extensions); for (int i = 0; i < extensions.length; ++i) { if (!extensions[i].equals(otherFilter.extensions[i])) return false; } return true; } }
FileChooserFilter extends FileFilter { @Override public boolean equals(final Object other) { if (!(other instanceof FileChooserFilter)) return false; final FileChooserFilter otherFilter = (FileChooserFilter) other; if (!otherFilter.description.equals(description)) return false; if (otherFilter.extensions.length != extensions.length) return false; Arrays.sort(otherFilter.extensions); Arrays.sort(extensions); for (int i = 0; i < extensions.length; ++i) { if (!extensions[i].equals(otherFilter.extensions[i])) return false; } return true; } FileChooserFilter(final String description, final String extension);  FileChooserFilter(final String description, final String[] extensions); }
FileChooserFilter extends FileFilter { @Override public boolean equals(final Object other) { if (!(other instanceof FileChooserFilter)) return false; final FileChooserFilter otherFilter = (FileChooserFilter) other; if (!otherFilter.description.equals(description)) return false; if (otherFilter.extensions.length != extensions.length) return false; Arrays.sort(otherFilter.extensions); Arrays.sort(extensions); for (int i = 0; i < extensions.length; ++i) { if (!extensions[i].equals(otherFilter.extensions[i])) return false; } return true; } FileChooserFilter(final String description, final String extension);  FileChooserFilter(final String description, final String[] extensions); @Override boolean accept(final File file); @Override String getDescription(); String[] getExtensions(); @Override boolean equals(final Object other); }
FileChooserFilter extends FileFilter { @Override public boolean equals(final Object other) { if (!(other instanceof FileChooserFilter)) return false; final FileChooserFilter otherFilter = (FileChooserFilter) other; if (!otherFilter.description.equals(description)) return false; if (otherFilter.extensions.length != extensions.length) return false; Arrays.sort(otherFilter.extensions); Arrays.sort(extensions); for (int i = 0; i < extensions.length; ++i) { if (!extensions[i].equals(otherFilter.extensions[i])) return false; } return true; } FileChooserFilter(final String description, final String extension);  FileChooserFilter(final String description, final String[] extensions); @Override boolean accept(final File file); @Override String getDescription(); String[] getExtensions(); @Override boolean equals(final Object other);  }