### Question:
DataMapUtils { public Collection getParameterNames(SelectQueryDescriptor query) { if (query.getQualifier() == null) { return Collections.EMPTY_SET; } Map<String, String> queryParameters = queriesMap.get(query.getName()); if (queryParameters == null) { queryParameters = getParameterNames(query.getQualifier(), query.getRoot()); queriesMap.put(query.getName(), queryParameters); } return parseQualifier(query.getQualifier().toString()); }  String getQueryMethodName(QueryDescriptor query); Collection getParameterNames(SelectQueryDescriptor query); Boolean isValidParameterNames(SelectQueryDescriptor query); boolean hasParameters(SelectQueryDescriptor query); String getParameterType(SelectQueryDescriptor query, String name);  }### Answer:
@Test public void testGetParameterNamesWithFilledQueriesMap() { String param = "param"; String qualifierString = "name = $" + param; SelectQueryDescriptor selectQueryDescriptor = new SelectQueryDescriptor(); Set<String> result = new LinkedHashSet<>(); assertEquals(result, dataMapUtils.getParameterNames(selectQueryDescriptor)); Expression exp = ExpressionFactory.exp(qualifierString); selectQueryDescriptor.setQualifier(exp); selectQueryDescriptor.setName("name"); Map<String, String> map = new HashMap<>(); map.put(param, "java.lang.String"); dataMapUtils.queriesMap.put("name", map); Collection collection = dataMapUtils.getParameterNames(selectQueryDescriptor); result.add(param); assertEquals(collection, result); }
@Test public void testGetParameterNamesWithEmptyQueriesMap() { DbEntity dbEntity = new DbEntity("test"); ObjAttribute attribute = new ObjAttribute("name"); attribute.setDbAttributePath("testKey"); attribute.setType("java.lang.String"); objEntity.addAttribute(attribute); objEntity.setName("test"); objEntity.setDbEntity(dbEntity); String param = "param"; String qualifierString = "name = $" + param; SelectQueryDescriptor selectQueryDescriptor = new SelectQueryDescriptor(); Expression exp = ExpressionFactory.exp(qualifierString); selectQueryDescriptor.setQualifier(exp); selectQueryDescriptor.setName("name"); selectQueryDescriptor.setRoot(objEntity); Collection collection = dataMapUtils.getParameterNames(selectQueryDescriptor); Map<String, Map<String, String>> queriesMap = new HashMap<>(); Map<String, String> map = new HashMap<>(); map.put(param, "java.lang.String"); queriesMap.put("name", map); assertEquals(dataMapUtils.queriesMap, queriesMap); Set<String> result = new LinkedHashSet<>(); result.add(param); assertEquals(collection, result); }