Repository navigation
Expand file tree
/
Copy pathListOps.java
More file actions
44 lines (33 loc) · 1.61 KB
/
Copy pathListOps.java
File metadata and controls
44 lines (33 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
class ListOps {
static <T> List<T> append(List<T> list1, List<T> list2) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T> List<T> concat(List<List<T>> listOfLists) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T> List<T> filter(List<T> list, Predicate<T> predicate) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T> int size(List<T> list) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T, U> List<U> map(List<T> list, Function<T, U> transform) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T> List<T> reverse(List<T> list) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T, U> U foldLeft(List<T> list, U initial, BiFunction<U, T, U> f) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
static <T, U> U foldRight(List<T> list, U initial, BiFunction<T, U, U> f) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
private ListOps() {
// No instances.
}
}