forked from functionaljava/functionaljava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListTest.java
More file actions
42 lines (27 loc) · 849 Bytes
/
Copy pathListTest.java
File metadata and controls
42 lines (27 loc) · 849 Bytes
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
package fj.data;
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Created by MarkPerry on 16/01/2015.
*/
public class ListTest {
@Test
public void objectMethods() {
int max = 5;
List<Integer> list = List.range(1, max);
assertTrue(list.equals(list));
assertTrue(list.equals(List.range(1, max)));
assertFalse(list.equals(List.single(1)));
assertFalse(list.equals(true));
assertFalse(list.equals(null));
assertTrue(List.list(1, 2).toString().equals("List(1,2)"));
}
@Test
public void integration() {
java.util.List<Integer> ul = Arrays.asList(1, 2, 3);
List<Integer> dl = List.list(ul);
assertTrue(ul.equals(dl.toJavaList()));
}
}