method reference: take type args into account

This commit is contained in:
Anna Kozlova
2014-08-08 19:49:15 +04:00
parent 2bdfb9591f
commit 7c6d93dfb4
2 changed files with 11 additions and 5 deletions
@@ -5,6 +5,7 @@ class Test {
void foo(final Stream<String> stream){
stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
stream.collect(ArrayList<String>::new, ArrayList::add, ArrayList::addAll);
stream.collect(ArrayList::new, Collection::add, Collection::addAll);
}