GICSCode implements Serializable { @FromString public static GICSCode of(final String code) { if (FORMAT.matcher(code).matches() == false) { throw new IllegalArgumentException("Invalid code : " + code); } return new GICSCode(code); } 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(dataProvider = "invalidInt", expectedExceptions = IllegalArgumentException.class) public void testInvalidInt(int code) { GICSCode.of(code); }
@Test(dataProvider = "invalidString", expectedExceptions = IllegalArgumentException.class) public void testInvalidString(String code) { GICSCode.of(code); }
@Test public void testValid1() { for (int i = 10; i <= 99; i++) { GICSCode.of(i); } }
@Test public void testValid2() { for (int i = 10; i <= 99; i++) { GICSCode.of(1000 + i); } }
@Test public void testValid3() { for (int i = 10; i <= 99; i++) { GICSCode.of(101000 + i); } }
@Test public void testValid4() { for (int i = 10; i <= 99; i++) { GICSCode.of(10101000 + i); } }