if (substitutionMap.size() == 1) {
return elementFactory.createType(targetClass, ContainerUtil.getFirstItem(substitutionMap.values()));
}
else {
LOG.assertTrue(substitutionMap.size() == 2);
<BUG>LOG.assertTrue(GuavaFunctionConversionRule.JAVA_UTIL_FUNCTION_FUNCTION.equals(targetClass.getQualifiedName()));
final PsiType returnType = LambdaUtil.getFunctionalInterfaceReturnType(currentType);</BUG>
final List<PsiType> types = new ArrayList<PsiType>(substitutionMap.values());
types.remove(returnType);
final PsiType parameterType = types.get(0);

if (substitutionMap.size() == 1) {
return elementFactory.createType(targetClass, ContainerUtil.getFirstItem(substitutionMap.values()));
}
else {
LOG.assertTrue(substitutionMap.size() == 2);
LOG.assertTrue(GuavaLambda.FUNCTION.getJavaAnalogueClassQName().equals(targetClass.getQualifiedName()));
final PsiType returnType = LambdaUtil.getFunctionalInterfaceReturnType(currentType);
final List<PsiType> types = new ArrayList<PsiType>(substitutionMap.values());
types.remove(returnType);
final PsiType parameterType = types.get(0);
