ParametersValidator { public static void checkNotBlank(String value, String errorMessage) throws ParametersException { if (StringUtils.isBlank(value)) { throw new ParametersException(errorMessage); } } private  ParametersValidator(); static void checkRange(int value, int min, int max, String errorMessage); static void checkNotBlank(String value, String errorMessage); static void checkAtLeastOneNotBlank(String errorMessage, String... values); static void checkParameter(boolean expression, String errorMessage);  }
@Test public void testCheckNotBlank_valid() throws Exception { ParametersValidator.checkNotBlank("not blank", "Error"); }
@Test(expected = ParametersException.class) public void testCheckNotBlank_forNull() throws Exception { ParametersValidator.checkNotBlank(null, "Error"); }
@Test(expected = ParametersException.class) public void testCheckNotBlank_forEmpty() throws Exception { ParametersValidator.checkNotBlank(" ", "Error"); }