diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java
index c3789b5..7c3e4cb 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/CommandLineCommandTest.java
@@ -98,22 +98,22 @@
         assertEquals(0, commandLineCommand.compareTo(commandLineCommand));
         CommandLineCommand otherCommand = new CommandLineCommand();
         otherCommand.setSystemCommand(true);
-        assertThat(commandLineCommand.compareTo(otherCommand)).isNotZero();
+        assertThat(commandLineCommand).isNotEqualByComparingTo(otherCommand);
         otherCommand.getArgumentList().add(new CommandLineArgument("testArgument"));
-        assertThat(commandLineCommand.compareTo(otherCommand)).isNotZero();
+        assertThat(commandLineCommand).isNotEqualByComparingTo(otherCommand);
     }
 
     @Test
     public void testCompareKeywordList() {
         CommandLineCommand otherCommand = new CommandLineCommand();
         otherCommand.getKeywordlist().add("test");
-        assertThat(commandLineCommand.compareTo(otherCommand)).isNotZero();
+        assertThat(commandLineCommand).isNotEqualByComparingTo(otherCommand);
         commandLineCommand.getKeywordlist().add("test");
         assertEquals(0, commandLineCommand.compareTo(otherCommand));
         commandLineCommand.getKeywordlist().add("test2");
-        assertThat(commandLineCommand.compareTo(otherCommand)).isNotZero();
+        assertThat(commandLineCommand).isNotEqualByComparingTo(otherCommand);
         otherCommand.getKeywordlist().add("test3");
-        assertThat(commandLineCommand.compareTo(otherCommand)).isNotZero();
+        assertThat(commandLineCommand).isNotEqualByComparingTo(otherCommand);
     }
 
     @Test
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
index 65a253f..e45c479 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
@@ -111,7 +111,7 @@
             schemaHelper = new SchemaHelperFactory().createSchemaHelper(albumDefinition.getKey(),
                     albumDefinition.getItemSchema());
         } catch (final ContextRuntimeException e) {
-            final String resultString = "could not initiate schema management for context album " + albumDefinition;
+            final var resultString = "could not initiate schema management for context album " + albumDefinition;
             LOGGER.warn(resultString, e);
             throw new ContextException(resultString, e);
         }
@@ -237,7 +237,7 @@
     @Override
     public Object get(final Object key) {
         if (key == null) {
-            final String returnString =
+            final var returnString =
                     ALBUM + albumDefinition.getId() + "\" null keys are illegal on keys for get()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -304,21 +304,21 @@
     @Override
     public Object put(final String key, final Object incomingValue) {
         if (key == null) {
-            final String returnString =
+            final var returnString =
                     ALBUM + albumDefinition.getId() + "\" null keys are illegal on keys for put()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
 
         if (incomingValue == null) {
-            final String returnString = ALBUM + albumDefinition.getId() + "\" null values are illegal on key \""
+            final var returnString = ALBUM + albumDefinition.getId() + "\" null values are illegal on key \""
                     + key + "\" for put()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
 
         if (!albumDefinition.isWritable()) {
-            final String returnString = ALBUM + albumDefinition.getId()
+            final var returnString = ALBUM + albumDefinition.getId()
                     + "\" put() not allowed on read only albums for key=\"" + key + "\", value=\"" + incomingValue;
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -342,7 +342,7 @@
             // Put the translated value on the map and return the old map value
             return albumMap.put(key, valueToPut);
         } catch (final ContextRuntimeException e) {
-            final String returnString = "Failed to set context value for key \"" + key + "\" in album \""
+            final var returnString = "Failed to set context value for key \"" + key + "\" in album \""
                     + albumDefinition.getId() + "\": " + e.getMessage();
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString, e);
@@ -355,7 +355,7 @@
     @Override
     public void putAll(final Map<? extends String, ? extends Object> incomingContextAlbum) {
         if (!albumDefinition.isWritable()) {
-            final String returnString =
+            final var returnString =
                     ALBUM + albumDefinition.getId() + "\" putAll() not allowed on read only albums";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -390,7 +390,7 @@
     @Override
     public Object remove(final Object key) {
         if (!albumDefinition.isWritable()) {
-            final String returnString = ALBUM + albumDefinition.getId()
+            final var returnString = ALBUM + albumDefinition.getId()
                     + "\" remove() not allowed on read only albums for key=\"" + key + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -416,7 +416,7 @@
     @Override
     public void clear() {
         if (!albumDefinition.isWritable()) {
-            final String returnString =
+            final var returnString =
                     ALBUM + albumDefinition.getId() + "\" clear() not allowed on read only albums";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
index 4d5d01c..d47ac9e 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
@@ -143,7 +143,7 @@
         // Get the context album definition
         final AxContextAlbum album = ModelService.getModel(AxContextAlbums.class).get(axContextAlbumKey);
         if (album == null) {
-            final String resultString = "context album " + axContextAlbumKey.getId() + " does not exist";
+            final var resultString = "context album " + axContextAlbumKey.getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
         }
@@ -151,7 +151,7 @@
         // Check if the context album is valid
         final AxValidationResult result = album.validate(new AxValidationResult());
         if (!result.isValid()) {
-            final String resultString = "context album definition for " + album.getKey().getId() + " is invalid"
+            final var resultString = "context album definition for " + album.getKey().getId() + " is invalid"
                             + result;
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
@@ -160,7 +160,7 @@
         // Get the schema of the context album
         final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(album.getItemSchema());
         if (schema == null) {
-            final String resultString = "schema \"" + album.getItemSchema().getId() + "\" for context album "
+            final var resultString = "schema \"" + album.getItemSchema().getId() + "\" for context album "
                             + album.getKey().getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
index 3e7e0e8..431c387 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
@@ -67,7 +67,7 @@
 
         // Check the class is a distributor
         if (!(contextDistributorObject instanceof Distributor)) {
-            final String returnString = "Specified Apex context distributor plugin class \"" + pluginClass
+            final var returnString = "Specified Apex context distributor plugin class \"" + pluginClass
                     + "\" does not implement the ContextDistributor interface";
             throw new ContextException(returnString);
         }
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
index 2c23889..97261ad 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
@@ -85,7 +85,7 @@
     @Override
     public Object createNewInstance() {
         if (schemaClass == null) {
-            final String returnString =
+            final var returnString =
                     userKey.getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -94,7 +94,7 @@
         try {
             return schemaClass.getDeclaredConstructor().newInstance();
         } catch (final Exception e) {
-            final String returnString =
+            final var returnString =
                     userKey.getId() + ": could not create an instance of class \"" + schemaClass.getName()
                             + "\" using the default constructor \"" + schemaClass.getSimpleName() + "()\"";
             LOGGER.warn(returnString, e);
@@ -108,7 +108,7 @@
     @Override
     public Object createNewInstance(final String stringValue) {
         if (schemaClass == null) {
-            final String returnString =
+            final var returnString =
                     userKey.getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -121,7 +121,7 @@
             // Invoke the constructor
             return stringConstructor.newInstance(stringValue);
         } catch (final Exception e) {
-            final String returnString =
+            final var returnString =
                     userKey.getId() + ": could not create an instance of class \"" + schemaClass.getName()
                             + "\" using the string constructor \"" + schemaClass.getSimpleName() + "(String)\"";
             LOGGER.warn(returnString, e);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
index d1cd3b1..a5fa268 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
@@ -63,7 +63,7 @@
         // Get the schema for items in the album
         final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(schemaKey);
         if (schema == null) {
-            final String resultString =
+            final var resultString =
                     "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextRuntimeException(resultString);
@@ -76,7 +76,7 @@
         final SchemaHelperParameters schemaHelperParameters =
                 schemaParameters.getSchemaHelperParameters(schema.getSchemaFlavour());
         if (schemaHelperParameters == null) {
-            final String resultString = "context schema helper parameters not found for context schema  \""
+            final var resultString = "context schema helper parameters not found for context schema  \""
                     + schema.getSchemaFlavour() + "\"";
             LOGGER.warn(resultString);
             throw new ContextRuntimeException(resultString);
@@ -88,7 +88,7 @@
         try {
             schemaHelperObject = Class.forName(pluginClass).getDeclaredConstructor().newInstance();
         } catch (final Exception e) {
-            final String resultString = "Apex context schema helper class not found for context schema helper plugin \""
+            final var resultString = "Apex context schema helper class not found for context schema helper plugin \""
                     + pluginClass + "\"";
             LOGGER.warn(resultString, e);
             throw new ContextRuntimeException(resultString, e);
@@ -96,7 +96,7 @@
 
         // Check the class is a schema helper
         if (!(schemaHelperObject instanceof SchemaHelper)) {
-            final String resultString = "Specified Apex context schema helper plugin class \"" + pluginClass
+            final var resultString = "Specified Apex context schema helper plugin class \"" + pluginClass
                     + "\" does not implement the SchemaHelper interface";
             LOGGER.warn(resultString);
             throw new ContextRuntimeException(resultString);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
index 43288f4..7d67788 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
@@ -101,14 +101,14 @@
         }
 
         if (getSchemaClass() == null) {
-            final String returnString =
+            final var returnString =
                     getUserKey().getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
 
         if (incomingObject instanceof JsonElement) {
-            final String elementJsonString = getGson().toJson((JsonElement) incomingObject);
+            final var elementJsonString = getGson().toJson((JsonElement) incomingObject);
             return getGson().fromJson(elementJsonString, this.getSchemaClass());
         }
 
@@ -116,7 +116,7 @@
             return incomingObject;
         }
 
-        final String returnString = getUserKey().getId() + ": the object \"" + incomingObject + "\" of type \""
+        final var returnString = getUserKey().getId() + ": the object \"" + incomingObject + "\" of type \""
                 + incomingObject.getClass().getName()
                 + "\" is not an instance of JsonObject and is not assignable to \"" + getSchemaClass().getName() + "\"";
         LOGGER.warn(returnString);
@@ -163,7 +163,7 @@
             // Use Gson to translate the object
             return getGson().toJson(schemaObject);
         } else {
-            final String returnString = getUserKey().getId() + ": object \"" + schemaObject.toString()
+            final var returnString = getUserKey().getId() + ": object \"" + schemaObject.toString()
                     + "\" of class \"" + schemaObject.getClass().getName() + "\" not compatible with class \""
                     + getSchemaClass().getName() + "\"";
             LOGGER.warn(returnString);
@@ -220,7 +220,7 @@
             final Constructor<?> stringConstructor = getSchemaClass().getConstructor(String.class);
             return stringConstructor.newInstance(object.toString());
         } catch (final Exception e) {
-            final String returnString = getUserKey().getId() + ": object \"" + object.toString() + "\" of class \""
+            final var returnString = getUserKey().getId() + ": object \"" + object.toString() + "\" of class \""
                     + object.getClass().getName() + "\" not compatible with class \"" + getSchemaClass().getName()
                     + "\"";
             LOGGER.warn(returnString, e);
@@ -253,7 +253,7 @@
             try {
                 adapterObject = jsonAdapterEntry.getAdaptorClazz().getDeclaredConstructor().newInstance();
             } catch (Exception e) {
-                final String returnString = getUserKey().getId() + ": instantiation of adapter class \""
+                final var returnString = getUserKey().getId() + ": instantiation of adapter class \""
                         + jsonAdapterEntry.getAdaptorClass() + "\"  to decode and encode class \""
                         + jsonAdapterEntry.getAdaptedClass() + "\" failed: " + e.getMessage();
                 LOGGER.warn(returnString, e);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
index c373237..9a668e9 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
@@ -46,7 +46,7 @@
      */
     public void monitorInit(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final Object value) {
-        String monitorInitString = monitor("INIT", null, albumKey, schemaKey, name, value);
+        var monitorInitString = monitor("INIT", null, albumKey, schemaKey, name, value);
         LOGGER.trace(monitorInitString);
     }
 
@@ -61,7 +61,7 @@
      */
     public void monitorInit(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final Object value, final AxConcept[] userArtifactStack) {
-        String monitorInitString = monitor("INIT", userArtifactStack, albumKey, schemaKey, name, value);
+        var monitorInitString = monitor("INIT", userArtifactStack, albumKey, schemaKey, name, value);
         LOGGER.trace(monitorInitString);
     }
 
@@ -76,7 +76,7 @@
      */
     public void monitorDelete(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final Object value, final AxConcept[] userArtifactStack) {
-        String monitorDeleteString = monitor("DEL", userArtifactStack, albumKey, schemaKey, name, value);
+        var monitorDeleteString = monitor("DEL", userArtifactStack, albumKey, schemaKey, name, value);
         LOGGER.trace(monitorDeleteString);
     }
 
@@ -91,7 +91,7 @@
      */
     public void monitorGet(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final Object value, final AxConcept[] userArtifactStack) {
-        String monitorGetString = monitor("GET", userArtifactStack, albumKey, schemaKey, name, value);
+        var monitorGetString = monitor("GET", userArtifactStack, albumKey, schemaKey, name, value);
         LOGGER.trace(monitorGetString);
     }
 
@@ -106,7 +106,7 @@
      */
     public void monitorSet(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final Object value, final AxConcept[] userArtifactStack) {
-        String monitorSetString = monitor("SET", userArtifactStack, albumKey, schemaKey, name, value);
+        var monitorSetString = monitor("SET", userArtifactStack, albumKey, schemaKey, name, value);
         LOGGER.trace(monitorSetString);
     }
 
@@ -120,7 +120,7 @@
      */
     public void monitorReadLock(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final AxConcept[] userArtifactStack) {
-        String monitorReadLockString = monitor("READLOCK", userArtifactStack, albumKey, schemaKey, name, null);
+        var monitorReadLockString = monitor("READLOCK", userArtifactStack, albumKey, schemaKey, name, null);
         LOGGER.trace(monitorReadLockString);
     }
 
@@ -134,7 +134,7 @@
      */
     public void monitorWriteLock(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final AxConcept[] userArtifactStack) {
-        String writeLockMonitorString = monitor("WRITELOCK", userArtifactStack, albumKey, schemaKey, name, null);
+        var writeLockMonitorString = monitor("WRITELOCK", userArtifactStack, albumKey, schemaKey, name, null);
         LOGGER.trace(writeLockMonitorString);
     }
 
@@ -148,7 +148,7 @@
      */
     public void monitorReadUnlock(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final AxConcept[] userArtifactStack) {
-        String monitorReadUnlockString = monitor("READUNLOCK", userArtifactStack, albumKey, schemaKey, name, null);
+        var monitorReadUnlockString = monitor("READUNLOCK", userArtifactStack, albumKey, schemaKey, name, null);
         LOGGER.trace(monitorReadUnlockString);
     }
 
@@ -162,7 +162,7 @@
      */
     public void monitorWriteUnlock(final AxArtifactKey albumKey, final AxArtifactKey schemaKey, final String name,
             final AxConcept[] userArtifactStack) {
-        String monitorWriteUnlockString = monitor("WRITEUNLOCK", userArtifactStack, albumKey, schemaKey, name, null);
+        var monitorWriteUnlockString = monitor("WRITEUNLOCK", userArtifactStack, albumKey, schemaKey, name, null);
         LOGGER.trace(monitorWriteUnlockString);
     }
 
@@ -179,13 +179,13 @@
      */
     private String monitor(final String preamble, final AxConcept[] userArtifactStack, final AxArtifactKey albumKey,
             final AxArtifactKey schemaKey, final String name, final Object value) {
-        final StringBuilder builder = new StringBuilder();
+        final var builder = new StringBuilder();
 
         builder.append(preamble);
         builder.append(",[");
 
         if (userArtifactStack != null) {
-            boolean first = true;
+            var first = true;
             for (final AxConcept stackKey : userArtifactStack) {
                 if (first) {
                     first = false;
