StringsConfig implements Serializable { public void setMinLength(int minLength) { if (minLength < 1) { throw new IllegalArgumentException("Invalid minimum length"); } this.minLength = minLength; } StringsConfig();  StringsConfig(InputStream is); String getStringsPath(); int getMinLength(); StringsEncoding getEncoding(); int getTimeout(); void setStringsPath(String path); void setMinLength(int minLength); void setEncoding(StringsEncoding encoding); void setTimeout(int timeout);  }
@Test(expected=IllegalArgumentException.class) public void testValidateEconding() { StringsConfig config = new StringsConfig(); config.setMinLength(0); }