### Question:
NamedParameterTypes extends ParameterTypes { @Override public List<Pair<ParameterTypes, ParameterConversions>> candidates() { Set<Pair<ParameterTypes, ParameterConversions>> result = new LinkedHashSet<>(); int n = namedTypes.size(); List<String> paramNames = new ArrayList<>(namedTypes.keySet()); int m = ConversionKind.values().length; int[] conversionMap = init(n); conversionMap = next(conversionMap, n, m); while (conversionMap != null) { Map<String, Type> newTypes = new LinkedHashMap<>(); NamedParameterConversions conversions = new NamedParameterConversions(); boolean different = false; for (int i = 0; i < n; i++) { ConversionKind kind = ConversionKind.values()[conversionMap[i]]; String paramName = paramNames.get(i); Type type = namedTypes.get(paramName); Type newType = type; Conversion conversion = new Conversion(NONE, newType); if (kind == LIST_TO_ELEMENT) { if (type instanceof ListType) { newType = ((ListType) type).getElementType(); conversion = new Conversion(kind, newType); different = true; } } newTypes.put(paramName, newType); conversions.add(paramName, conversion); } if (different) { NamedParameterTypes newSignature = new NamedParameterTypes(newTypes); result.add(new Pair<>(newSignature, conversions)); } conversionMap = next(conversionMap, n, m); } return new ArrayList<>(result); } NamedParameterTypes(Map<String, Type> namedTypes); @Override int size(); @Override boolean compatible(List<FormalParameter> parameters); @Override List<Pair<ParameterTypes, ParameterConversions>> candidates(); Type getType(String name); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testCandidates() { ParameterTypes pt = getParameterTypes(); List<Pair<ParameterTypes, ParameterConversions>> candidates = pt.candidates(); assertEquals(0, candidates.size()); Map<String, Type> namedTypes = new LinkedHashMap<>(); namedTypes.put("numbers", ListType.NUMBER_LIST); namedTypes.put("string", StringType.STRING); pt = new NamedParameterTypes(namedTypes); candidates = pt.candidates(); assertEquals(1, candidates.size()); Pair<ParameterTypes, ParameterConversions> candidate = candidates.get(0); assertEquals("Pair(NamedParameterTypes(numbers : number, string : string), NamedParameterConversions({numbers=Conversion(LIST_TO_ELEMENT, number), string=Conversion(NONE, string)}))", candidate.toString()); }