### Question:
MapInjectionResolver extends InjectionResolver<Param> { public static Object convertListToObject(AnnotatedElement target, Class type, List<String> paramValList) { Param param = target.getAnnotation(Param.class); if (!param.multiple()) { if (paramValList.size() == 1) return convertStringToObject(target, type, paramValList.get(0)); throw new UnacceptableValueException( localStrings.getLocalString("TooManyValues", "Invalid parameter: {0}. This parameter may not have " + "more than one value.", CommandModel.getParamName(param, target))); } Object paramValue = paramValList; if (type.isAssignableFrom(List.class)) { } else if (type.isAssignableFrom(String[].class)) { paramValue = paramValList.toArray(new String[paramValList.size()]); } else if (type.isAssignableFrom(File[].class)) { paramValue = convertListToFiles(paramValList); } else if (type.isAssignableFrom(Properties.class)) { paramValue = convertListToProperties(paramValList); } return paramValue; } MapInjectionResolver(CommandModel model,
					ParameterMap parameters);  MapInjectionResolver(CommandModel model,
					ParameterMap parameters,
                                        final MultiMap<String,File> optionNameToUploadedFileMap); void setContext(ExecutionContext context); @Override boolean isOptional(AnnotatedElement element, Param annotation); @Override V getValue(Object component, AnnotatedElement target, Type genericType, Class<V> type); static String getUploadedFileParamValue(final String fieldName,
                final Class fieldType,
                final MultiMap<String,File> optionNameToFileMap); static List<String> getUploadedFileParamValues(
                final String fieldName,
                final Class fieldType,
                final MultiMap<String,File> optionNameToFileMap); static Object convertListToObject(AnnotatedElement target,
                                    Class type, List<String> paramValList); static final LocalStringManagerImpl localStrings; }### Answer:
@Test public void convertListToObjectTest() throws Exception { DummyCommand dc = new DummyCommand(); Class<?> cl = dc.getClass(); AnnotatedElement target = (AnnotatedElement)cl.getDeclaredField("propm"); List<String> paramValueList = new ArrayList<String>(); paramValueList.add("prop1=valA"); paramValueList.add("prop2=valB"); paramValueList.add("prop3=valC"); Object paramValActual = MapInjectionResolver.convertListToObject( target, Properties.class, paramValueList); Object paramValExpected = new Properties(); ((Properties)paramValExpected).put("prop1", "valA"); ((Properties)paramValExpected).put("prop2", "valB"); ((Properties)paramValExpected).put("prop3", "valC"); assertEquals("Properties type", paramValExpected, paramValActual); paramValueList.clear(); paramValueList.add("server1"); paramValueList.add("server2"); paramValueList.add("server3"); target = (AnnotatedElement)cl.getDeclaredField("lstrm"); paramValActual = MapInjectionResolver.convertListToObject( target, List.class, paramValueList); assertEquals("List type", paramValueList, paramValActual); target = (AnnotatedElement)cl.getDeclaredField("astrm"); paramValActual = MapInjectionResolver.convertListToObject( target, (new String[]{}).getClass(), paramValueList); String[] strArray = new String[3]; strArray[0] = "server1"; strArray[1] = "server2"; strArray[2] = "server3"; assertEquals("String Array type", strArray, (String[])paramValActual); }