feat: add accumulator to MyListCollector
This commit is contained in:
@@ -13,4 +13,9 @@ public class MyListCollector <T> implements Collector<T, MyList<T>, MyList<T>>
|
|||||||
{
|
{
|
||||||
return () -> new MyLinkedList<>();
|
return () -> new MyLinkedList<>();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public BiConsumer<MyList<T>, T> accumulator() {
|
||||||
|
|
||||||
|
return (list, element) -> list.add(element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user