CadController { protected boolean checkAreMandatoryParametersValid(List<String> mandatoryList) { boolean valid = false; logger.debug(" Mandatory parameters to check : " + mandatoryList); if (mandatoryList != null && !mandatoryList.isEmpty() && !mandatoryList.contains(null)){ valid = true; logger.debug(" Mandatory parameters are ok"); } return valid; } CadController();   }
@Test public void testCheckAreMandatoryParametersValid() { Assert.assertFalse(cadController.checkAreMandatoryParametersValid(null)); ArrayList<String> testList = new ArrayList<String>(); Assert.assertFalse(cadController.checkAreMandatoryParametersValid(testList)); testList.add("test"); Assert.assertTrue(cadController.checkAreMandatoryParametersValid(testList)); testList.add(null); Assert.assertFalse(cadController.checkAreMandatoryParametersValid(testList)); }