@Test(expected = IllegalArgumentException.class) public void testNegativeMaxValueIsNotPossible() throws Exception { Length.max(-1); }
public static Validation max(final int maxLength) { if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be positive"); } return new Length(-1, maxLength); }
Length implements Validation { public static Validation max(final int maxLength) { if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be positive"); } return new Length(-1, maxLength); } }
Length implements Validation { public static Validation max(final int maxLength) { if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be positive"); } return new Length(-1, maxLength); } private  Length(final int minLength, final int maxLength); }
Length implements Validation { public static Validation max(final int maxLength) { if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be positive"); } return new Length(-1, maxLength); } private  Length(final int minLength, final int maxLength); static Validation min(final int minLength); static Validation max(final int maxLength); static Validation range(final int minLength, final int maxLength); @Override String getErrorMessage(final Context context); @Override boolean isValid(final String text); }
Length implements Validation { public static Validation max(final int maxLength) { if (maxLength <= 0) { throw new IllegalArgumentException("maxLength must be positive"); } return new Length(-1, maxLength); } private  Length(final int minLength, final int maxLength); static Validation min(final int minLength); static Validation max(final int maxLength); static Validation range(final int minLength, final int maxLength); @Override String getErrorMessage(final Context context); @Override boolean isValid(final String text);  }