MimeType implements Comparable<IMimeType>, IMimeType { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IMimeType other = (IMimeType) obj; if ( name == null ) { if ( other.getName() != null ) { return false; } } else if ( !name.equals( other.getName() ) ) { return false; } return true; } MimeType();  MimeType( String name, List<String> extensions );  MimeType( String name, String extensions ); @Override String getName(); @Override void setName( String name ); @Override List<String> getExtensions(); @Override boolean isHidden(); @Override void setHidden( boolean hidden ); @Override boolean isLocale(); @Override void setLocale( boolean locale ); @Override boolean isVersionEnabled(); @Override void setVersionEnabled( boolean versionEnabled ); @Override boolean isVersionCommentEnabled(); @Override void setVersionCommentEnabled( boolean versionCommentEnabled ); @XmlTransient @Override Converter getConverter(); @Override void setConverter( Converter converter ); @Override void setExtensions( List<String> extensions ); @Override String toString(); @Override int compareTo( IMimeType o ); @Override int hashCode(); @Override boolean equals( Object obj );  }
@Test public void equalTest() { MimeType mimeType2 = new MimeType(); assertTrue( mimeType.equals( mimeType2 ) ); mimeType = new MimeType( MIME_NAME, EXTENSIONS1 ); assertFalse( mimeType.equals( mimeType2 ) ); assertFalse( mimeType2.equals( mimeType ) ); mimeType2 = new MimeType( MIME_NAME2, EXTENSIONS1 ); assertTrue( mimeType.equals( mimeType ) ); assertFalse( mimeType2.equals( mimeType ) ); mimeType2 = new MimeType( MIME_NAME, EXTENSIONS1 ); assertTrue( mimeType.equals( mimeType2 ) ); assertFalse( mimeType.equals( null ) ); assertFalse( mimeType.equals( "abc" ) ); }