From fe99db81b3ab07042b4df51369bb49edea3fc27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Wed, 18 Jul 2018 17:54:44 +0200 Subject: [PATCH] modified: ../../test/bytecode/LambdaTest.java Lambda-Ausruck wird ausgewertet. Funktioniert nicht, vermutich, weil Lambda-Methode apply private --- test/bytecode/LambdaTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/bytecode/LambdaTest.java b/test/bytecode/LambdaTest.java index 1e13ac77b..9adfe5b89 100644 --- a/test/bytecode/LambdaTest.java +++ b/test/bytecode/LambdaTest.java @@ -33,11 +33,10 @@ public class LambdaTest { instanceOfClass = classToTest.getDeclaredConstructor().newInstance(); Method m = classToTest.getDeclaredMethod("m"); - //Class - Object lambda = (m.invoke(instanceOfClass)); //.getClass(); - //Method apply = lambda.getMethod("apply", Integer.class); - //Integer result = (Integer) apply.invoke(lambda, 77); - //assertEquals(77, result); + Class lambda = m.invoke(instanceOfClass).getClass(); + Method apply = lambda.getMethod("apply", Object.class); + Integer result = (Integer) apply.invoke(lambda, new Integer(77)); //laeuft nicht, vermutlich weil Lambda-Ausdruck private + assertEquals(77, result); }