### Question:
MediaTypeFilter extends Filter { public boolean equals(Object other) { if (this == other) { return true; } else if (other == null) { return false; } if (other instanceof MediaTypeFilter) { MediaTypeFilter otherMediaTypeMatcher = (MediaTypeFilter) other; return (getEqualsComparator().equals(otherMediaTypeMatcher.getEqualsComparator())); } return false; } MediaTypeFilter();  MediaTypeFilter(String mediaTypeRegEx); String getMediaTypeRegEx(); void setMediaTypeRegEx(String mediaTypeRegEx); int hashCode(); boolean equals(Object other); @Override boolean handleGet(RequestContext requestContext); @Override boolean handlePut(RequestContext requestContext); @Override boolean handleImportResource(RequestContext requestContext); @Override boolean handleDelete(RequestContext requestContext); @Override boolean handlePutChild(RequestContext requestContext); @Override boolean handleImportChild(RequestContext requestContext);  }### Answer:
@Test public void equals() throws Exception { MediaTypeFilter filter1 = new MediaTypeFilter("application/*"); MediaTypeFilter filter2 = filter1; assertTrue(filter2.equals(filter1)); MediaTypeFilter filter3 = new MediaTypeFilter(); filter3.setMediaTypeRegEx("application/*"); filter3.setInvert("false"); assertTrue(filter1.equals(filter3)); filter3.setInvert("true"); assertFalse(filter1.equals(filter3)); assertFalse(filter1.equals(null)); assertFalse(filter1.equals(new IndexingHandler())); }