GICSCode implements Serializable { @Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (obj instanceof GICSCode) { GICSCode other = (GICSCode) obj; return getCode().equals(other.getCode()); } return false; } private  GICSCode(final String code); @FromString static GICSCode of(final String code); static GICSCode of(final int code); @ToString String getCode(); int getCodeInt(); String getDescription(); String getSectorCode(); int getSectorCodeInt(); String getSectorDescription(); static Collection<String> getAllSectorDescriptions(); String getIndustryGroupCode(); int getIndustryGroupCodeInt(); String getIndustryGroupDescription(); static Collection<String> getAllIndustryGroupDescriptions(); String getIndustryCode(); int getIndustryCodeInt(); String getIndustryDescription(); static Collection<String> getAllIndustryDescriptions(); String getSubIndustryCode(); int getSubIndustryCodeInt(); String getSubIndustryDescription(); static Collection<String> getAllSubIndustryDescriptions(); boolean isComplete(); boolean isPartial(); GICSCode toSector(); GICSCode toIndustryGroup(); GICSCode toIndustry(); GICSCode toSubIndustry(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { GICSCode c1 = GICSCode.of("10"); GICSCode c2 = GICSCode.of(new String("10")); GICSCode c3 = GICSCode.of("1010"); assertTrue(c1.equals(c1)); assertTrue(c1.equals(c2)); assertFalse(c1.equals(c3)); assertFalse(c1.equals("String")); }