IsPositiveInteger implements Validation { @Override public boolean isValid(final String text) { return text.matches(POSITIVE_INT_PATTERN); } private  IsPositiveInteger(); static Validation build(); @Override String getErrorMessage(final Context context); @Override boolean isValid(final String text); static final String POSITIVE_INT_PATTERN; }
@Test public void testPositiveNumberIsValid() throws Exception { assertTrue(mIsPositiveInteger.isValid("1")); }
@Test public void testNegativeNumberIsNotValid() throws Exception { assertFalse(mIsPositiveInteger.isValid("-1")); }
@Test public void testTextIsNotValid() throws Exception { assertFalse(mIsPositiveInteger.isValid("text")); }