### Question:
ReportParametersHelper { public static List<ReportParameter> fromRawParameters(Map<String, String[]> reportParams) { List<ReportParameter> reportParameterList = null; if (reportParams != null && reportParams.size() > 0) { reportParameterList = new ArrayList<ReportParameter>(); for (String key : reportParams.keySet()) { ReportParameter reportParameter = new ReportParameter(); reportParameter.setName(key); if (reportParams.get(key) != null) { reportParameter.setValues(Arrays.asList(reportParams.get(key))); } reportParameterList.add(reportParameter); } } return reportParameterList; }  static Map<String, String[]> toRawParameters(List<ReportParameter> reportParameters); static List<ReportParameter> fromRawParameters(Map<String, String[]> reportParams);  }### Answer:
@Test public void fromRawParameters_null(){ assertNull(ReportParametersHelper.fromRawParameters(null)); }
@Test public void fromRawParameters(){ Map<String, String[]> parametersMap = new HashMap<String, String[]>(); parametersMap.put(NAME1, new String[] {VALUE1_1, VALUE1_2, VALUE1_3}); parametersMap.put(NAME2, new String[] {VALUE2_1, VALUE2_2, VALUE2_3}); final List<ReportParameter> result = ReportParametersHelper.fromRawParameters(parametersMap); assertNotNull(result); assertEquals(result.size(), 2); for(ReportParameter currentParameter : result){ if(NAME1.equals(currentParameter.getName())){ final List<String> values = currentParameter.getValues(); assertNotNull(values); assertEquals(values.size(), 3); assertTrue(values.contains(VALUE1_1)); assertTrue(values.contains(VALUE1_2)); assertTrue(values.contains(VALUE1_3)); } else if(NAME2.equals(currentParameter.getName())){ final List<String> values = currentParameter.getValues(); assertNotNull(values); assertEquals(values.size(), 3); assertTrue(values.contains(VALUE2_1)); assertTrue(values.contains(VALUE2_2)); assertTrue(values.contains(VALUE2_3)); } else { assertTrue(false); } } }