package com.github.dcevm.test.lambdas;
+import java.io.Serializable;
import java.util.concurrent.Callable;
-public class LambdaA {
- public Callable<Integer> createLambda() {
+public class LambdaA implements Serializable {
+ public SerializableCallable<Integer> createLambda() {
return () -> 10;
}
- public Callable<Integer> createLambda2() {
+ public SerializableCallable<Integer> createLambda2() {
return () -> 20;
}
}
package com.github.dcevm.test.lambdas;
+import java.io.Serializable;
import java.util.concurrent.Callable;
-public class LambdaA___1 {
+public class LambdaA___1 implements Serializable {
- public Callable<Integer> createLambda() {
+ public SerializableCallable<Integer> createLambda() {
return () -> 30;
}
- public Callable<Integer> createLambda2() {
+ public SerializableCallable<Integer> createLambda2() {
return () -> 40;
}
}
}
@Test
- @Ignore
public void testMethodLambda() throws Exception {
LambdaA a = new LambdaA();
Callable<Integer> lambda = a.createLambda();
--- /dev/null
+package com.github.dcevm.test.lambdas;
+
+import java.io.Serializable;
+import java.util.concurrent.Callable;
+
+/**
+ * Created by idubrov on 5/2/14.
+ */
+public interface SerializableCallable<T> extends Callable<T>, Serializable {
+}