Fix checkstyle violations in sal-binding-broker
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / md / sal / binding / 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.controller.md.sal.binding.test;
10
11 import java.util.Collection;
12 import java.util.Map;
13 import org.junit.Assert;
14
15 public final class AssertCollections {
16     private AssertCollections() {
17     }
18
19     public static void assertEmpty(final Collection<?> set) {
20         Assert.assertTrue(set.isEmpty());
21     }
22
23     public static void assertEmpty(final Map<?,?> set) {
24         Assert.assertTrue(set.isEmpty());
25     }
26
27     public static void assertContains(final Collection<?> set, final Object... values) {
28         for (Object key : values) {
29             Assert.assertTrue(set.contains(key));
30         }
31
32     }
33
34     public static void assertContains(final Map<?,?> map, final Object... values) {
35         for (Object key : values) {
36             Assert.assertTrue(map.containsKey(key));
37         }
38     }
39
40     public static void assertNotContains(final Collection<?> set, final Object... values) {
41         for (Object key : values) {
42             Assert.assertFalse(set.contains(key));
43         }
44     }
45
46     public static void assertNotContains(final Map<?,?> map, final Object... values) {
47         for (Object key : values) {
48             Assert.assertFalse(map.containsKey(key));
49         }
50     }
51 }