import java.io.Serializable;
import java.util.function.Function;
class Test {
interface I {
void foo();
}
interface A {
void bar(int i);
}
{
Object o1 = (Serializable & I) () -> {};
Object o2 = (I & Serializable) () -> {};
Object o3 = (I & Runnable) () -> {};
Object o4 = (A & Runnable) () -> {};
Object o5 = (Runnable & A) () -> {};
}
}
class Test1 {
interface A {
void foo();
}
interface B {
void foo();
}
{
Object c0 = (A & B) ()->{};
}
}
class Test2 {
{
foo(i -> i);
foo1(i -> i);
foo2(i -> i);
}
private static & A>> void foo(T t) { }
private static & Serializable> void foo1(T t) { }
private static & Serializable> void foo2(T t) { }
interface A {}
}