SLING-7802 update nullability annotations
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java b/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
index 2c0fbbc..72c7344 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
@@ -56,7 +56,7 @@
         return this;
     }
         
-    public @NotNull ComponentContextBuilder properties(@NotNull Object... properties) {
+    public @NotNull ComponentContextBuilder properties(@NotNull Object @NotNull ... properties) {
         this.properties = MapUtil.toDictionary(properties);
         return this;
     }
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java b/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
index b894805..30d1ac2 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
@@ -83,7 +83,7 @@
      * @param args Key/value pairs
      * @return Dictionary
      */
-    public static @Nullable Dictionary<String, Object> toDictionary(@NotNull Object... args) {
+    public static @Nullable Dictionary<String, Object> toDictionary(@NotNull Object @NotNull ... args) {
         return toDictionary(toMap(args));
     }
     
@@ -92,8 +92,8 @@
      * @param args Key/value pairs
      * @return Map
      */
-    @SuppressWarnings("unchecked")
-    public static Map<String, Object> toMap(@NotNull Object... args) {
+    @SuppressWarnings({ "unchecked", "null" })
+    public static @NotNull Map<String, Object> toMap(@NotNull Object @NotNull ... args) {
         if (args == null || args.length == 0) {
             return Collections.emptyMap();
         }
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index b8b417b..a8ec9b7 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -397,7 +397,7 @@
         // accept method, but ignore it
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "null" })
     <S> S locateService(final String name, final ServiceReference<S> reference) {
         for (MockServiceRegistration<?> serviceRegistration : this.registeredServices) {
             if (serviceRegistration.getReference() == reference) {
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
index 4619cdb..12766ab 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
@@ -89,7 +89,7 @@
      * @param properties Properties
      * @return Mocked {@link ComponentContext} instance
      */
-    public static @NotNull ComponentContext newComponentContext(@NotNull Object... properties) {
+    public static @NotNull ComponentContext newComponentContext(@NotNull Object @NotNull ... properties) {
         return componentContext().properties(properties).build();
     }
 
@@ -119,7 +119,7 @@
      * @return Mocked {@link ComponentContext} instance
      */
     public static @NotNull ComponentContext newComponentContext(@NotNull BundleContext bundleContext,
-            @NotNull Object... properties) {
+            @NotNull Object @NotNull ... properties) {
         return componentContext().bundleContext(bundleContext).properties(properties).build();
     }
 
@@ -204,7 +204,7 @@
      * @param properties Properties
      * @return true if activation method was called. False if no activate method is defined.
      */
-    public static boolean activate(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object... properties) {
+    public static boolean activate(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object @NotNull ... properties) {
         return activate(target, bundleContext, toDictionary(properties));
     }
 
@@ -249,7 +249,7 @@
      * @param properties Properties
      * @return true if deactivation method was called. False if no deactivate method is defined.
      */
-    public static boolean deactivate(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object... properties) {
+    public static boolean deactivate(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object @NotNull ... properties) {
         return deactivate(target, bundleContext, toDictionary(properties));
     }
 
@@ -284,7 +284,7 @@
      * @param properties Properties
      * @return true if modified method was called. False if no modified method is defined.
      */
-    public static boolean modified(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object... properties) {
+    public static boolean modified(@NotNull Object target, @NotNull BundleContext bundleContext, @NotNull Object @NotNull ... properties) {
         return modified(target, bundleContext, toDictionary(properties));
     }
     
@@ -304,7 +304,7 @@
      * @param pid PID
      * @param properties Configuration properties
      */
-    public static void setConfigForPid(@NotNull BundleContext bundleContext, @NotNull String pid, @NotNull Object... properties) {
+    public static void setConfigForPid(@NotNull BundleContext bundleContext, @NotNull String pid, @NotNull Object @NotNull ... properties) {
         setConfigForPid(bundleContext, pid, toDictionary(properties));
     }
     
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
index 57b8c3b..382b108 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -100,7 +100,7 @@
         return clazzes;
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "null" })
     T getService() {
         if (this.service instanceof ServiceFactory) {
             ServiceFactory<T> factory = (ServiceFactory<T>)this.service;
@@ -132,6 +132,7 @@
     /**
      * Try to read OSGI-metadata from /OSGI-INF and read all implemented interfaces
      */
+    @SuppressWarnings("null")
     private void readOsgiMetadata() {
         Class<?> serviceClass = service.getClass();
         OsgiMetadata metadata = OsgiMetadataUtil.getMetadata(serviceClass);
@@ -143,6 +144,7 @@
         clazzes.addAll(metadata.getServiceInterfaces());
     }
 
+    @SuppressWarnings("null")
     @Override
     public String toString() {
         return "#" + serviceId + " [" + StringUtils.join(clazzes, ",") + "]: " + service.toString();
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java b/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
index c60d41d..d4bd102 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
@@ -45,7 +45,7 @@
      * @param <T> context type
      * @param afterSetUpCallback Allows the application to register an own callback function that is called after the built-in setup rules are executed.
      */
-    public @NotNull <T extends OsgiContextImpl> ContextPlugins(final ContextCallback<T> afterSetUpCallback) {
+    public <T extends OsgiContextImpl> ContextPlugins(@NotNull final ContextCallback<T> afterSetUpCallback) {
         addAfterSetUpCallback(afterSetUpCallback);
     }
     
@@ -56,7 +56,7 @@
      * @param afterSetUpCallback Allows the application to register an own callback function that is called after the built-in setup rules are executed.
      * @param beforeTearDownCallback Allows the application to register an own callback function that is called before the built-in teardown rules are executed.
      */
-    public @NotNull <U extends OsgiContextImpl, V extends OsgiContextImpl> ContextPlugins(
+    public <U extends OsgiContextImpl, V extends OsgiContextImpl> ContextPlugins(
             @NotNull final ContextCallback<U> afterSetUpCallback, 
             @NotNull final ContextCallback<V> beforeTearDownCallback) {
         addAfterSetUpCallback(afterSetUpCallback);
@@ -68,8 +68,9 @@
      * @param <T> context type
      * @param plugin Plugin
      */
+    @SuppressWarnings({ "null", "unused" })
     @SafeVarargs
-    public final <T extends OsgiContextImpl> void addPlugin(@NotNull ContextPlugin<T>... plugin) {
+    public final <T extends OsgiContextImpl> void addPlugin(@NotNull ContextPlugin<T> @NotNull ... plugin) {
         for (final ContextPlugin<T> item : plugin) {
             if (item == null) {
                 continue;
@@ -83,8 +84,9 @@
      * @param <T> context type
      * @param beforeSetUpCallback Allows the application to register an own callback function that is called before the built-in setup rules are executed.
      */
+    @SuppressWarnings({ "null", "unused" })
     @SafeVarargs
-    public final <T extends OsgiContextImpl> void addBeforeSetUpCallback(@NotNull final ContextCallback<T>... beforeSetUpCallback) {
+    public final <T extends OsgiContextImpl> void addBeforeSetUpCallback(@NotNull final ContextCallback<T> @NotNull ... beforeSetUpCallback) {
         for (final ContextCallback<T> item : beforeSetUpCallback) {
             if (item == null) {
                 continue;
@@ -107,8 +109,9 @@
      * @param <T> context type
      * @param afterSetUpCallback Allows the application to register an own callback function that is called after the built-in setup rules are executed.
      */
+    @SuppressWarnings({ "null", "unused" })
     @SafeVarargs
-    public final <T extends OsgiContextImpl> void addAfterSetUpCallback(@NotNull final ContextCallback<T>... afterSetUpCallback) {
+    public final <T extends OsgiContextImpl> void addAfterSetUpCallback(@NotNull final ContextCallback<T> @NotNull ... afterSetUpCallback) {
         for (final ContextCallback<T> item : afterSetUpCallback) {
             if (item == null) {
                 continue;
@@ -131,8 +134,9 @@
      * @param <T> context type
      * @param beforeTearDownCallback Allows the application to register an own callback function that is called before the built-in teardown rules are executed.
      */
+    @SuppressWarnings({ "null", "unused" })
     @SafeVarargs
-    public final <T extends OsgiContextImpl> void addBeforeTearDownCallback(@NotNull final ContextCallback<T>... beforeTearDownCallback) {
+    public final <T extends OsgiContextImpl> void addBeforeTearDownCallback(@NotNull final ContextCallback<T> @NotNull ... beforeTearDownCallback) {
         for (final ContextCallback<T> item : beforeTearDownCallback) {
             if (item == null) {
                 continue;
@@ -155,8 +159,9 @@
      * @param <T> context type
      * @param afterTearDownCallback Allows the application to register an own callback function that is after before the built-in teardown rules are executed.
      */
+    @SuppressWarnings({ "null", "unused" })
     @SafeVarargs
-    public final <T extends OsgiContextImpl> void addAfterTearDownCallback(@NotNull final ContextCallback<T>... afterTearDownCallback) {
+    public final <T extends OsgiContextImpl> void addAfterTearDownCallback(@NotNull final ContextCallback<T> @NotNull ... afterTearDownCallback) {
         for (final ContextCallback<T> item : afterTearDownCallback) {
             if (item == null) {
                 continue;
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java b/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
index b6ac3dd..c6e7849 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
@@ -131,7 +131,7 @@
      * @param properties Service properties (optional)
      * @return Registered service instance
      */
-    public final @NotNull <T> T registerService(@Nullable final Class<T> serviceClass, @NotNull final T service, @NotNull final Object... properties) {
+    public final @NotNull <T> T registerService(@Nullable final Class<T> serviceClass, @NotNull final T service, @NotNull final Object @NotNull ... properties) {
         return registerService(serviceClass, service, MapUtil.toMap(properties));
     }
     
@@ -169,7 +169,7 @@
      * @param properties Service properties (optional)
      * @return Registered service instance
      */
-    public final @NotNull <T> T registerInjectActivateService(@NotNull final T service, @NotNull final Object... properties) {
+    public final @NotNull <T> T registerInjectActivateService(@NotNull final T service, @NotNull final Object @NotNull ... properties) {
         return registerInjectActivateService(service, MapUtil.toMap(properties));
     }
 
@@ -198,7 +198,7 @@
      * @throws RuntimeException If the <code>filter</code> string is not a valid OSGi service filter string.
      */
     @SuppressWarnings({ "unchecked", "null" })
-    public final @NotNull <ServiceType> ServiceType[] getServices(@NotNull final Class<ServiceType> serviceType, @Nullable final String filter) {
+    public final @NotNull <ServiceType> ServiceType @NotNull [] getServices(@NotNull final Class<ServiceType> serviceType, @Nullable final String filter) {
         try {
             ServiceReference[] serviceReferences = bundleContext().getServiceReferences(serviceType.getName(), filter);
             if (serviceReferences != null) {
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
index f4749ab..81bd569 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
@@ -44,7 +44,7 @@
      * @return this
      */
     @SafeVarargs
-    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder plugin(@NotNull ContextPlugin<T>... plugin) {
+    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder plugin(@NotNull ContextPlugin<T> @NotNull ... plugin) {
         plugins.addPlugin(plugin);
         return this;
     }
@@ -55,7 +55,7 @@
      * @return this
      */
     @SafeVarargs
-    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeSetUp(@NotNull ContextCallback<T>... beforeSetUpCallback) {
+    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeSetUp(@NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback) {
         plugins.addBeforeSetUpCallback(beforeSetUpCallback);
         return this;
     }
@@ -66,7 +66,7 @@
      * @return this
      */
     @SafeVarargs
-    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterSetUp(@NotNull ContextCallback<T>... afterSetUpCallback) {
+    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterSetUp(@NotNull ContextCallback<T> @NotNull ... afterSetUpCallback) {
         plugins.addAfterSetUpCallback(afterSetUpCallback);
         return this;
     }
@@ -77,7 +77,7 @@
      * @return this
      */
     @SafeVarargs
-    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeTearDown(@NotNull ContextCallback<T>... beforeTearDownCallback) {
+    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeTearDown(@NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback) {
         plugins.addBeforeTearDownCallback(beforeTearDownCallback);
         return this;
     }
@@ -88,7 +88,7 @@
      * @return this
      */
     @SafeVarargs
-    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterTearDown(@NotNull ContextCallback<T>... afterTearDownCallback) {
+    public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterTearDown(@NotNull ContextCallback<T> @NotNull ... afterTearDownCallback) {
         plugins.addAfterTearDownCallback(afterTearDownCallback);
         return this;
     }