Bump to odlparent-5.0.6/yangtools-3.0.10
[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 package org.opendaylight.mdsal.binding.dom.adapter.test;
9
10 import java.util.Collection;
11 import java.util.Map;
12 import org.junit.Assert;
13
14 public final class AssertCollections {
15     private AssertCollections() {
16     }
17
18     public static void assertEmpty(final Collection<?> set) {
19         Assert.assertTrue(set.isEmpty());
20     }
21
22     public static void assertEmpty(final Map<?,?> set) {
23         Assert.assertTrue(set.isEmpty());
24     }
25
26     public static void assertContains(final Collection<?> set, final Object... values) {
27         for (Object key : values) {
28             Assert.assertTrue(set.contains(key));
29         }
30     }
31
32     public static void assertContains(final Map<?,?> map, final Object... values) {
33         for (Object key : values) {
34             Assert.assertTrue(map.containsKey(key));
35         }
36     }
37
38     public static void assertNotContains(final Collection<?> set, final Object... values) {
39         for (Object key : values) {
40             Assert.assertFalse(set.contains(key));
41         }
42     }
43
44     public static void assertNotContains(final Map<?,?> map, final Object... values) {
45         for (Object key : values) {
46             Assert.assertFalse(map.containsKey(key));
47         }
48     }
49 }