ParametersValidator { public static void checkParameter(boolean expression, String errorMessage) throws ParametersException { if (!expression) { 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 testCheckParameter_valid() throws Exception { ParametersValidator.checkParameter(true, "Error"); }
@Test(expected = ParametersException.class) public void testCheckParameter_inValid() throws Exception { ParametersValidator.checkParameter(false, "Error"); }