CadController { protected boolean isMandatoryParameterValid(String parameter) { boolean valid = false; logger.debug(" Mandatory parameters to check : " + parameter); if (parameter != null && !parameter.isEmpty()){ valid = true; logger.debug(" Mandatory parameter is ok"); } return valid; } CadController();   }
@Test public void testIsMandatoryParameterValid() { Assert.assertFalse(cadController.isMandatoryParameterValid(null)); Assert.assertFalse(cadController.isMandatoryParameterValid("")); Assert.assertTrue(cadController.isMandatoryParameterValid("valid")); }