c85622dcb09ad9797080daaf811962824e686d21
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / test / AssertCollections.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.mdsal.binding.dom.adapter.test;
10
11 import java.util.Collection;
12 import java.util.Map;
13
14 import org.junit.Assert;
15
16 public final class AssertCollections {
17
18     private AssertCollections() {
19     }
20
21     public static void assertEmpty(final Collection<?> set) {
22         Assert.assertTrue(set.isEmpty());
23     }
24
25     public static void assertEmpty(final Map<?,?> set) {
26         Assert.assertTrue(set.isEmpty());
27     }
28
29     public static void assertContains(final Collection<?> set, final Object... values) {
30         for (Object key : values) {
31             Assert.assertTrue(set.contains(key));
32         }
33
34     }
35
36     public static void assertContains(final Map<?,?> map, final Object... values) {
37         for (Object key : values) {
38             Assert.assertTrue(map.containsKey(key));
39         }
40     }
41
42     public static void assertNotContains(final Collection<?> set, final Object... values) {
43         for (Object key : values) {
44             Assert.assertFalse(set.contains(key));
45         }
46     }
47
48     public static void assertNotContains(final Map<?,?> map, final Object... values) {
49         for (Object key : values) {
50             Assert.assertFalse(map.containsKey(key));
51         }
52     }
53
54
55
56 }