Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / sal / binding / test / AugmentationVerifier.java
index 227354c41e1f50bfbd62b8edbd82c2928d83d0b3..45eed6a0695a20ee0bcbc1d1eb9bb6314b96e808 100644 (file)
@@ -7,33 +7,33 @@
  */
 package org.opendaylight.controller.sal.binding.test;
 
-import junit.framework.Assert;
-
+import static org.junit.Assert.assertNotNull;
 
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
+@Deprecated
 public class AugmentationVerifier<T extends Augmentable<T>> {
 
-    private T object;
+    private final T object;
 
-    public AugmentationVerifier(T objectToVerify) {
+    public AugmentationVerifier(final T objectToVerify) {
         this.object = objectToVerify;
     }
 
-    public AugmentationVerifier<T> assertHasAugmentation(Class<? extends Augmentation<T>> augmentation) {
+    public AugmentationVerifier<T> assertHasAugmentation(final Class<? extends Augmentation<T>> augmentation) {
         assertHasAugmentation(object, augmentation);
-        return (AugmentationVerifier<T>) this;
+        return this;
     }
 
-    public static <T extends Augmentable<T>> void assertHasAugmentation(T object,
-            Class<? extends Augmentation<T>> augmentation) {
-        Assert.assertNotNull(object);
-        Assert.assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", object.getAugmentation(augmentation));
+    public static <T extends Augmentable<T>> void assertHasAugmentation(final T object,
+            final Class<? extends Augmentation<T>> augmentation) {
+        assertNotNull(object);
+        assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.",
+                object.augmentation(augmentation));
     }
 
-    public static <T extends Augmentable<T>> AugmentationVerifier<T> from(T obj) {
-        return new AugmentationVerifier<T>(obj);
+    public static <T extends Augmentable<T>> AugmentationVerifier<T> from(final T obj) {
+        return new AugmentationVerifier<>(obj);
     }
-
 }