ICBCode implements ImmutableBean, Serializable { public static ICBCode of(final int code) { if ((code < 1000) || (code > 9999)) { throw new IllegalArgumentException("Code out of range: " + code); } return ICBCode.of(Integer.toString(code)); } @ImmutableConstructor private  ICBCode(final String code); static ICBCode of(final int code); static ICBCode of(final String code); String getClassificationName(); String getCode(); static ICBCode.Meta meta(); @Override ICBCode.Meta metaBean(); @Override Property<R> property(String propertyName); @Override Set<String> propertyNames(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final String NAME; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullCode() { ICBCode.of(null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testLowCode() { ICBCode.of(999); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testHighCode() { ICBCode.of(10000); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testInvalidCode() { ICBCode.of("345r"); }