feat: added the get-all method and tests

This commit is contained in:
Гаджикурбанов Темирлан
2026-08-31 00:35:45 +03:00
parent e77b8c5956
commit c5cf12827a
3 changed files with 139 additions and 0 deletions
@@ -79,6 +79,14 @@ public class MyLinkedList<T> implements MyList<T> {
public boolean isEmpty() {
return size == 0;
}
public void addAll(MyList<? extends T> collection) {
if (collection == null || collection.isEmpty()) {
return;
}
for (int i = 0; i < collection.size(); i++) {
add(collection.get(i));
}
}
@Override
public String toString() {
@@ -13,4 +13,5 @@ public interface MyList<T> {
int size();
boolean isEmpty();
void addAll(MyList<? extends T> collection);
}