ContainUtilTestpublic class ContainUtilTest extends TestCase
Methods Summary |
---|
public void | testComplexList()
List<MyObject> l = new ArrayList<MyObject>();
l.add(new MyObject("tm_jee", 20));
l.add(new MyObject("jenny", 22));
assertFalse(ContainUtil.contains(l, new MyObject("paul", 50)));
assertFalse(ContainUtil.contains(l, new MyObject("tm_jee", 44)));
assertTrue(ContainUtil.contains(l, new MyObject("tm_jee", 20)));
assertTrue(ContainUtil.contains(l, new MyObject("jenny", 22)));
| public void | testComplexMap()
Set<MyObject> s = new LinkedHashSet<MyObject>();
s.add(new MyObject("tm_jee", 20));
s.add(new MyObject("jenny", 22));
assertFalse(ContainUtil.contains(s, new MyObject("paul", 50)));
assertFalse(ContainUtil.contains(s, new MyObject("tm_jee", 44)));
assertTrue(ContainUtil.contains(s, new MyObject("tm_jee", 20)));
assertTrue(ContainUtil.contains(s, new MyObject("jenny", 22)));
| public void | testNull()
assertFalse(ContainUtil.contains(null, null));
assertFalse(ContainUtil.contains(new Object(), null));
assertFalse(ContainUtil.contains(null, new Object()));
| public void | testObject()
assertFalse(ContainUtil.contains("aaa", "bbb"));
assertFalse(ContainUtil.contains(new MyObject("tm_jee", 22), new MyObject("tmjee", 22)));
assertTrue(ContainUtil.contains("apple", "apple"));
assertTrue(ContainUtil.contains(new MyObject("tm_jee", 22), new MyObject("tm_jee", 22)));
| public void | testSimpleList()
List<String> l = new ArrayList<String>();
l.add("one");
l.add("two");
assertFalse(ContainUtil.contains(l, "three"));
assertTrue(ContainUtil.contains(l, "one"));
assertTrue(ContainUtil.contains(l, "two"));
| public void | testSimpleSet()
Set<String> s = new LinkedHashSet<String>();
s.add("one");
s.add("two");
assertFalse(ContainUtil.contains(s, "thre"));
assertTrue(ContainUtil.contains(s, "one"));
assertTrue(ContainUtil.contains(s, "two"));
|
|