/* * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.util.*; class Test { interface Foo { void foo(T t); } interface IntFoo { void foo(int i); } interface ObjectFoo { void foo(int i); } interface FooList { void foo(List tList); } void f(Foo foo) { System.out.println("Foo"); } void f(FooList foo) { System.out.println("FooList"); } /*void f(IntFoo foo) { System.out.println("IntFoo"); }*/ /*void f(ObjectFoo foo) { System.out.println("ObjectFoo"); }*/ public static void main(String[] args) { new Test().f(null); new Test().f(x -> {}); } } class Test1 { interface Foo { void foo(T t); } interface IntFoo { void foo(int i); } interface ObjectFoo { void foo(int i); } interface FooList { void foo(List tList); } void f(Foo foo) { System.out.println("Foo"); } void f(FooList foo) { System.out.println("FooList"); } void f(IntFoo foo) { System.out.println("IntFoo"); } /*void f(ObjectFoo foo) { System.out.println("ObjectFoo"); }*/ public static void main(String[] args) { new Test1().f(null); new Test1().f(x -> {}); } } class Test2 { interface Foo { void foo(T t); } interface IntFoo { void foo(int i); } interface ObjectFoo { void foo(int i); } interface FooList { void foo(List tList); } void f(Foo foo) { System.out.println("Foo"); } void f(FooList foo) { System.out.println("FooList"); } void f(IntFoo foo) { System.out.println("IntFoo"); } void f(ObjectFoo foo) { System.out.println("ObjectFoo"); } public static void main(String[] args) { new Test2().f(null); new Test2().f(x -> {}); } } class Test3 { interface Foo { void foo(T t); } interface IntFoo { void foo(int i); } interface ObjectFoo { void foo(int i); } interface FooList { void foo(List tList); } void f(Foo foo) { System.out.println("Foo"); } void f(FooList foo) { System.out.println("FooList"); } /*void f(IntFoo foo) { System.out.println("IntFoo"); }*/ void f(ObjectFoo foo) { System.out.println("ObjectFoo"); } public static void main(String[] args) { new Test3().f(null); new Test3().f(x -> {}); } } class Test { interface Foo { void foo(T t, T t1); } interface Foo1 { void foo(T t, String t1); } interface Foo2 { void foo(String t, String t1); } void f(Foo foo) { System.out.println("Foo"); } void f(Foo1 foo) { System.out.println("FooList"); } void f(Foo2 foo) { System.out.println("FooList"); } public static void main(String[] args) { new Test().f((String x, String y) -> {}); } }