### Question:
ParamValueValidator implements IncomingMessageFormParameterValidator { public boolean validate(IncomingMessageFormParameter param) { String value = caseSensitive ? param.getValue().trim() : param.getValue().trim().toUpperCase(); param.setMessageFormParamStatus(IncMessageFormParameterStatus.INVALID); param.setValue(value); if (!values.isEmpty()){ String[] valArr = values.split(","); for(String val : valArr){ if(val.equals(param.getValue())){ param.setMessageFormParamStatus(IncMessageFormParameterStatus.VALID); break; } } } else param.setMessageFormParamStatus(IncMessageFormParameterStatus.VALID); if(param.getMessageFormParamStatus() == IncMessageFormParameterStatus.INVALID){ param.setErrCode(3); param.setErrText("out of range"); } else if (conversions != null && conversions.containsKey(value)) { param.setValue(conversions.get(value)); } param.setLastModified(new Date()); return param.getMessageFormParamStatus().equals(IncMessageFormParameterStatus.VALID); }  boolean validate(IncomingMessageFormParameter param); void setValues(String values); void setConversions(Map<String, String> conversions); void setCaseSensitive(boolean caseSensitive);  }### Answer:
@Test public void testValidate() { System.out.println("validate"); IncomingMessageFormParameter param = new IncomingMessageFormParameterImpl(); param.setIncomingMsgFormParamDefinition(new IncomingMessageFormParameterDefinitionImpl()); param.getIncomingMsgFormParamDefinition().setParamType("BOOLEAN"); param.setValue("y"); ParamValueValidator instance = new ParamValueValidator(); instance.setCaseSensitive(true); instance.setValues("Y,N"); boolean expResult = false; boolean result = instance.validate(param); assertEquals(expResult, result); assertEquals(param.getMessageFormParamStatus(), IncMessageFormParameterStatus.INVALID); assertEquals(param.getErrCode(), 3); assertEquals(param.getErrText(), "out of range"); param.setMessageFormParamStatus(IncMessageFormParameterStatus.NEW); instance.setCaseSensitive(false); expResult = true; result = instance.validate(param); assertEquals(expResult, result); assertEquals(param.getMessageFormParamStatus(), IncMessageFormParameterStatus.VALID); param.setMessageFormParamStatus(IncMessageFormParameterStatus.NEW); HashMap<String,String> conversions = new HashMap<String,String>(); conversions.put("Y", "true"); instance.setConversions(new HashMap<String,String>()); instance.setConversions(conversions); expResult = true; result = instance.validate(param); assertEquals(expResult, result); assertEquals(param.getValue(), "true"); assertEquals(param.getMessageFormParamStatus(), IncMessageFormParameterStatus.VALID); }