IsEmail implements Validation { @Override public String getErrorMessage(final Context context) { return context.getString(R.string.formvalidations_not_email); } private  IsEmail(); static Validation build(); @Override String getErrorMessage(final Context context); @Override boolean isValid(final String text);  }
@Test public void testGetErrorMessage() throws Exception { final String errorMessage = mIsEmail.getErrorMessage(mActivity); assertNotNull(errorMessage); }