AbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest
[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
14 import org.junit.Assert;
15
16 public class AssertCollections {
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
33     public static void assertNotContains(final Collection<?> set, final Object... values) {
34         for (Object key : values) {
35             Assert.assertFalse(set.contains(key));
36         }
37     }
38
39     public static void assertContains(final Map<?,?> map, final Object... values) {
40         for (Object key : values) {
41             Assert.assertTrue(map.containsKey(key));
42         }
43     }
44
45     public static void assertNotContains(final Map<?,?> map, final Object... values) {
46         for (Object key : values) {
47             Assert.assertFalse(map.containsKey(key));
48         }
49     }
50 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.