提交 da885977 编写于 作者: K khadgarmage 提交者: dailidong

unittest-demo (#1337)

上级 97d1cd3f
......@@ -30,34 +30,30 @@ public class CollectionUtilsTest {
@Test
public void equalLists() {
List<Integer> a = new ArrayList<Integer>();
a.add(1);
a.add(2);
a.add(3);
List<Integer> b = new ArrayList<Integer>();
b.add(3);
b.add(2);
b.add(1);
Assert.assertTrue(CollectionUtils.equalLists(a,b));
Assert.assertTrue(CollectionUtils.equalLists(null,null));
List<Integer> c = new ArrayList<Integer>();
Assert.assertFalse(CollectionUtils.equalLists(c,null));
Assert.assertFalse(CollectionUtils.equalLists(c,a));
}
@Test
public void subtract() {
Set<Integer> a = new HashSet<Integer>();
a.add(1);
a.add(2);
a.add(3);
Set<Integer> b = new HashSet<Integer>();
b.add(0);
b.add(2);
b.add(4);
Assert.assertArrayEquals(new Integer[]{1,3},CollectionUtils.subtract(a,b).toArray());
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册