package me.tomassetti.symbolsolver.resolution;

import com.github.javaparser.ParseException;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.MethodDeclaration;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.stmt.ReturnStmt;
import com.github.javaparser.ast.stmt.SwitchStmt;
import me.tomassetti.symbolsolver.javaparser.Navigator;
import me.tomassetti.symbolsolver.model.declarations.ValueDeclaration;
import me.tomassetti.symbolsolver.model.resolution.SymbolReference;
import me.tomassetti.symbolsolver.model.typesystem.TypeUsage;
import me.tomassetti.symbolsolver.resolution.javaparser.JavaParserFacade;
import me.tomassetti.symbolsolver.resolution.typesolvers.JreTypeSolver;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class LambdaTest extends AbstractTest {

    @Test
    public void lambdaMap() throws ParseException {
        CompilationUnit cu = parseSample("Lambda");
        com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz = Navigator.demandClass(cu, "Agenda");
        MethodDeclaration method = Navigator.demandMethod(clazz, "lambdaMap");
        ReturnStmt returnStmt = Navigator.findReturnStmt(method);
        Expression expression = returnStmt.getExpr();

        TypeUsage type = JavaParserFacade.get(new JreTypeSolver()).getType(expression);
        assertEquals("java.util.stream.Stream<java.lang.String>", type.describe());
    }


}

@@ -358,244 +358,55 @@
 ort 
-com.github.javaparser.ast.stmt.SwitchStmt;%0Aimport me.tomassetti.symbolsolver.javaparser.Navigator;%0Aimport me.tomassetti.symbolsolver.model.declarations.ValueDeclaration;%0Aimport me.tomassetti.symbolsolver.model.resolution.SymbolReference
+me.tomassetti.symbolsolver.javaparser.Navigator
 ;%0Aim
@@ -683,51 +683,8 @@
 als;
-%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Apu
@@ -729,16 +729,821 @@
 Test %7B%0A%0A
+    @Test%0A    public void lambdaMapParameter() throws ParseException %7B%0A        CompilationUnit cu = parseSample(%22Lambda%22);%0A        com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz = Navigator.demandClass(cu, %22Agenda%22);%0A        MethodDeclaration method = Navigator.demandMethod(clazz, %22lambdaMap%22);%0A        ReturnStmt returnStmt = Navigator.findReturnStmt(method);%0A        MethodCallExpr methodCallExpr = (MethodCallExpr)returnStmt.getExpr();%0A        Expression expression = methodCallExpr.getArgs().get(0);%0A%0A        JavaParserFacade javaParserFacade = JavaParserFacade.get(new JreTypeSolver());%0A        TypeUsage type = javaParserFacade.getType(expression);%0A        assertEquals(%22java.util.function.Function%3C? super java.lang.String,? extends java.lang.String%3E%22, type.describe());%0A    %7D%0A%0A%0A
     @Tes
@@ -1964,37 +1964,56 @@
 );%0A%0A        
-TypeUsage typ
+JavaParserFacade javaParserFacad
 e = JavaPars
@@ -2045,16 +2045,59 @@
 olver())
+;%0A        TypeUsage type = javaParserFacade
 .getType

add LambdaTest.lambdaMapParameter