Java Compile Error: Method reference in combination with overloading
I have the following class with an overloaded method: import java.util.ArrayList; import java.util.concurrent.Callable; public abstract class Test { public void test1 () { doStuff (ArrayList::new); // compilation error } public void test2 () { doStuff ( () -> new ArrayList<> ()); } public abstract void doStuff (Runnable runable); public abstract void doStuff (Callable<ArrayList<String>> callable); } The method test1 results in a compilation error with the error message The method doStuff(Runnable) is ambiguous for the type Test . I've added a third method test3 which looks like this: public