### Question:
TargetingChannel implements Serializable { public static TargetingChannel build(Map<String, Object> map) { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> mapClone = new HashMap<>(); for (Map.Entry<String, Object> entry : map.entrySet()) { Object value = entry.getValue(); String key = entry.getKey(); if (value == null || String.valueOf(value).equals("null")) { continue; } if (!key.equals("priceModel") && !key.equals("pm")) { if (value instanceof Collection) { mapClone.put(key, value); } else { List<String> newValue = new ArrayList<>(Arrays.asList((String.valueOf(value)))); mapClone.put(key, newValue); } } else { mapClone.put(key, value); } } TargetingChannel result = mapper.convertValue(mapClone, TargetingChannel.class); return result; }  static List<String> addAllAttributeValues(List<TargetingChannel> tcs, String attributeName); static TargetingChannel build(Map<String, Object> map); List<String> getAttributeValue(String attributeName); void setAttributeValue(String attributeName, Object value); List<String> getAis(); void setAis(List<String> ais); List<String> getPdas(); void setPreDefinedAudience(List<String> preDefinedAudience); List<String> getDms(); void setDeviceModel(List<String> deviceModel); List<String> getAus(); void setAus(List<String> appUsage); void setDms(List<String> dms); void setPdas(List<String> pdas); List<String> getR(); void setR(List<String> r); List<String> getG(); void setG(List<String> g); List<String> getA(); void setA(List<String> a); List<String> getT(); void setT(List<String> t); List<String> getSi(); void setSi(List<String> si); List<String> getM(); void setM(List<String> m); List<String> getDpc(); void setDpc(List<String> dpc); List<String> getIpl(); void setIpl(List<String> ipl); List<String> getExclude_pdas(); void setExclude_pdas(List<String> exclude_pdas); List<String> getApps(); void setApps(List<String> apps); List<String> getExclude_apps(); void setExclude_apps(List<String> exclude_apps); PriceModel getPm(); void setPm(String pm); List<String> getIplCityCodes(); void setIplCityCodes(List<String> iplCityCodes); List<String> getResidenceCityNames(); void setResidenceCityNames(List<String> residenceCityNames); static List<String> convertToList(String v); @JsonIgnore String getQueryKey(); boolean hasMultiValues(); @Override String toString();  }### Answer:
@Test public void build() { Map<String, Object> map = new HashMap(); map.put("gender", "g_f"); TargetingChannel res = TargetingChannel.build(map); TargetingChannel exp = new TargetingChannel(); exp.setG(Arrays.asList("g_f")); assertEquals(exp.toString(), res.toString()); map = new HashMap(); map.put("pm", "CPC"); res = TargetingChannel.build(map); exp = new TargetingChannel(); exp.setPm("CPC"); assertEquals(exp.toString(), res.toString()); map = new HashMap(); List<Integer> age = new ArrayList(); age.add(0); age.add(2); map.put("age", age); res = TargetingChannel.build(map); exp = new TargetingChannel(); exp.setA(Arrays.asList("0", "2")); assertEquals(exp.toString(), res.toString()); }