### Question:
L4Classifier extends Classifier { @Override protected void checkPresenceOfRequiredParams(Map<String, ParameterValue> params) { validatePortParam(params, L4ClassifierDefinition.SRC_PORT_PARAM, L4ClassifierDefinition.SRC_PORT_RANGE_PARAM); validatePortParam(params, L4ClassifierDefinition.DST_PORT_PARAM, L4ClassifierDefinition.DST_PORT_RANGE_PARAM); validateRange(params, L4ClassifierDefinition.SRC_PORT_RANGE_PARAM); validateRange(params, L4ClassifierDefinition.DST_PORT_RANGE_PARAM); } L4Classifier(Classifier parent); @Override ClassifierDefinitionId getId(); @Override ClassifierDefinition getClassifierDefinition(); @Override List<SupportedParameterValues> getSupportedParameterValues();  }### Answer:
@Test public void testCheckPresenceOfRequiredParams_Empty() throws Exception { l4Cl.checkPresenceOfRequiredParams(new HashMap<String, ParameterValue>()); }
@Test public void testCheckPresenceOfRequiredParams_SinglePorts() throws Exception { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_PARAM, pvSrcPort80); params.put(L4ClassifierDefinition.DST_PORT_PARAM, pvDstPort80); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_PortRanges() throws Exception { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_RANGE_PARAM, pvSrcRange81_82); params.put(L4ClassifierDefinition.DST_PORT_RANGE_PARAM, pvDstRange81_82); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_DstPortNull() throws IllegalArgumentException { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_PARAM, pvSrcPort80); params.put(L4ClassifierDefinition.DST_PORT_PARAM, pvDstPort_null); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(L4Classifier.EXC_MSG_PARAM_VALUE_NOT_SPECIFIED); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_DstRangeNull() throws IllegalArgumentException { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_PARAM, pvSrcPort80); params.put(L4ClassifierDefinition.DST_PORT_RANGE_PARAM, pvDstRange_null); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(L4Classifier.EXC_MSG_PARAM_VALUE_NOT_SPECIFIED); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_ParamConflict() throws IllegalArgumentException { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_PARAM, pvSrcPort80); params.put(L4ClassifierDefinition.SRC_PORT_RANGE_PARAM, pvSrcRange81_82); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(L4Classifier.EXC_MSG_MUT_EXCLUSIVE_PARAMS); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_RangeInverted() throws IllegalArgumentException { Map<String, ParameterValue> params = new HashMap<>(); params.put(L4ClassifierDefinition.SRC_PORT_PARAM, pvSrcPort80); params.put(L4ClassifierDefinition.DST_PORT_RANGE_PARAM, pvDstRange82_81); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(L4Classifier.EXC_MSG_RANGE_VALUE_MISMATCH); l4Cl.checkPresenceOfRequiredParams(params); }
@Test public void testCheckPresenceOfRequiredParams_emptyParams() { l4Cl.checkPresenceOfRequiredParams(new HashMap<String, ParameterValue>()); }