diff --git a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
index 4303186..a11e8b4 100644
--- a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
+++ b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
@@ -95,7 +95,7 @@
 				}
 			}
 		}
-		Boolean failureFlag = false;
+		Boolean failureFlag;
 		int i = 0;
 		do{
 			failureFlag = false;
@@ -118,6 +118,7 @@
 	 * (non-Javadoc)
 	 * @see org.onap.policy.utils.BackUpHandler#runOnNotification(org.onap.policy.api.PDPNotification)
 	 */
+	@Override
 	public void runOnNotification(PDPNotification notification){
 		if(notification.getNotificationType().equals(NotificationType.REMOVE)){
 			removedPolicies(notification.getRemovedPolicies());
diff --git a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
index c923c3c..6e8588a 100644
--- a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
+++ b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
@@ -388,11 +388,11 @@
                     selectedName = responseAttributes.get(key);
                 }
                 // kmodule configurations
-                else if (key.equals("kSessionName")) {
+                else if ("kSessionName".equals(key)) {
                     kSessionName = responseAttributes.get(key);
                 }
                 // Check User Specific values.
-                if (key.equals("$controller:")) {
+                if ("$controller:".equals(key)) {
                     try {
                         PEDependency dependency = PolicyUtils.jsonStringToObject(responseAttributes.get(key),
                                 PEDependency.class);
@@ -402,7 +402,7 @@
                         LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error while resolving Controller: " + e);
                     }
 
-                } else if (key.equals("$dependency$")) {
+                } else if ("$dependency$".equals(key)) {
                     String value = responseAttributes.get(key);
                     if (value.startsWith("[") && value.endsWith("]")) {
                         value = value.substring(1, value.length() - 1).trim();
@@ -500,7 +500,7 @@
         List<?> pList = query.getResultList();
         boolean createFlag = false;
         BRMSPolicyInfo brmsPolicyInfo = new BRMSPolicyInfo();
-        if (pList.size() > 0) {
+        if (!pList.isEmpty()) {
             // Already exists.
             brmsPolicyInfo = (BRMSPolicyInfo) pList.get(0);
             if (!brmsPolicyInfo.getControllerName().getControllerName().equals(controllerName)) {
@@ -514,7 +514,7 @@
             query.setParameter("cn", controllerName);
             List<?> bList = query.getResultList();
             BRMSGroupInfo brmsGroupInfo = new BRMSGroupInfo();
-            if (bList.size() > 0) {
+            if (!bList.isEmpty()) {
                 brmsGroupInfo = (BRMSGroupInfo) bList.get(0);
             }
             brmsPolicyInfo.setPolicyName(policyName);
@@ -528,7 +528,7 @@
     private void syncProject(String selectedName) {
         boolean projectExists = checkProject(selectedName);
         if (projectExists) {
-            String version = null;
+            String version;
             version = getVersion(selectedName);
             if (version == null) {
                 LOGGER.error("Error getting local version for the given Controller Name:" + selectedName
@@ -599,7 +599,6 @@
                 }
                 fos.close();
                 is.close();
-                f = null;
                 LOGGER.info(fileName + " Created..");
             }
         }
@@ -641,7 +640,7 @@
 
     private boolean checkRemoteSync(String selectedName, String version) {
         List<NexusArtifact> artifacts = getArtifactFromNexus(selectedName, version);
-        return (artifacts.size() == 0) ? false : true;
+        return artifacts.isEmpty() ? false : true;
     }
 
     private List<NexusArtifact> getArtifactFromNexus(String selectedName, String version) {
@@ -690,7 +689,7 @@
         if (artifact != null) {
             newVersion = incrementVersion(artifact.getVersion());
         }
-        if (newVersion.equals("0.1.0")) {
+        if ("0.1.0".equals(newVersion)) {
             createFlag = true;
         }
         setVersion(newVersion, selectedName);
@@ -736,8 +735,9 @@
         }
         if (!modifiedGroups.isEmpty()) {
             Boolean flag = false;
-            for (String group : modifiedGroups.keySet()) {
+            for (Map.Entry<String, String> entry : modifiedGroups.entrySet()) {
                 InvocationResult result = null;
+		String group = entry.getKey();
                 try {
                     InvocationRequest request = new DefaultInvocationRequest();
                     setVersion(group);
@@ -761,7 +761,7 @@
                     if (createFlag) {
                         addNotification(group, "create");
                     } else {
-                        addNotification(group, modifiedGroups.get(group));
+                        addNotification(group, entry.getValue());
                     }
                     flag = true;
                 } else {
@@ -795,7 +795,7 @@
             return policyMap.get(name);
         } else {
             syncGroupInfo();
-            return (policyMap.containsKey(name)) ? policyMap.get(name) : null;
+            return policyMap.containsKey(name) ? policyMap.get(name) : null;
         }
     }
 
@@ -869,7 +869,7 @@
             pub.send("MyPartitionKey", message);
 
             final List<?> stuck = pub.close(uebDelay, TimeUnit.SECONDS);
-            if (stuck.size() > 0) {
+            if (!stuck.isEmpty()) {
                 LOGGER.error(stuck.size() + " messages unsent");
             } else {
                 LOGGER.debug("Clean exit; Message Published on UEB : " + uebList + "for Topic: " + pubTopic);
@@ -1018,7 +1018,7 @@
     }
 
     private void readGroups(Properties config) throws PolicyException {
-        String[] groupNames = null;
+        String[] groupNames;
         if (!config.containsKey("groupNames") || config.getProperty("groupNames")==null){
             throw new PolicyException(XACMLErrorConstants.ERROR_DATA_ISSUE
                     + "groupNames property is missing or empty from the property file ");
@@ -1069,7 +1069,7 @@
         query.setParameter("cn", name);
         List<?> groupList = query.getResultList();
         BRMSGroupInfo brmsGroupInfo = null;
-        if (groupList.size() > 0) {
+        if (!groupList.isEmpty()) {
             LOGGER.info("Controller name already Existing in DB. Will be updating the DB Values" + name);
             brmsGroupInfo = (BRMSGroupInfo) groupList.get(0);
         }
@@ -1122,8 +1122,8 @@
         Query query = em.createQuery("select b from BRMSPolicyInfo as b where b.policyName = :pn");
         query.setParameter("pn", policyName);
         List<?> pList = query.getResultList();
-        BRMSPolicyInfo brmsPolicyInfo = new BRMSPolicyInfo();
-        if (pList.size() > 0) {
+        BRMSPolicyInfo brmsPolicyInfo;
+        if (!pList.isEmpty()) {
             // Already exists.
             brmsPolicyInfo = (BRMSPolicyInfo) pList.get(0);
             if (brmsPolicyInfo.getControllerName().getControllerName().equals(controllerName)) {
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/ia/DbAuditCompareEntriesTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/ia/DbAuditCompareEntriesTest.java
index f913c18..13255ba 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/ia/DbAuditCompareEntriesTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/ia/DbAuditCompareEntriesTest.java
@@ -233,7 +233,7 @@
 		 
 		
 		entry1.setFlag("flag1");
-		entry1.setResoruceNodeName("node1");
+		entry1.setResourceNodeName("node1");
 		entry1.setResourceName("resourceName");
 		entry1.setTimeStamp(new Date());
 		
diff --git a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdEngineTest.java b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdEngineTest.java
new file mode 100644
index 0000000..6600a92
--- /dev/null
+++ b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdEngineTest.java
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-XACML
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.xacml.test.std.pap;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.xacml.api.pap.OnapPDP;
+import org.onap.policy.xacml.std.pap.StdEngine;
+
+import com.att.research.xacml.api.pap.PAPException;
+import com.att.research.xacml.std.pap.StdPDP;
+
+public class StdEngineTest {
+	
+	private static Logger logger = FlexLogger.getLogger(StdEngineTest.class);
+	private Path repository;
+	Properties properties = new Properties();
+	StdEngine stdEngine = null;
+	
+	@Before
+	public void setUp(){
+	
+		repository = Paths.get("src/test/resources/pdps");
+		try {
+			stdEngine = new StdEngine(repository);
+		} catch (PAPException e) {
+			logger.info(e);
+		} catch (IOException e) {
+			logger.info(e);
+		}
+	}
+
+	@Test
+	public void testGetDefaultGroup(){
+		try {
+			assertTrue(stdEngine.getDefaultGroup() != null);
+		} catch (PAPException e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetGroup(){
+		try {
+			assertTrue(stdEngine.getGroup("1") == null);
+		} catch (PAPException e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetOnapPDPGroups(){
+		try {
+			assertTrue(stdEngine.getOnapPDPGroups() != null);
+		} catch (PAPException e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetPDP(){
+		try {
+			assertTrue(stdEngine.getPDP("1") == null);
+		} catch (PAPException e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetPDPGroup(){
+		try {
+			assertTrue(stdEngine.getPDPGroup(null) == null);
+		} catch (PAPException e) {
+			logger.info(e);
+		}
+	}
+}
diff --git a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java
new file mode 100644
index 0000000..da7476b
--- /dev/null
+++ b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPAPPolicyTest.java
@@ -0,0 +1,543 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-XACML
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.xacml.test.std.pap;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.xacml.api.pap.OnapPDP;
+import org.onap.policy.xacml.std.pap.StdEngine;
+import org.onap.policy.xacml.std.pap.StdPAPPolicy;
+
+import com.att.research.xacml.api.pap.PAPException;
+import com.att.research.xacml.std.pap.StdPDP;
+
+public class StdPAPPolicyTest {
+	
+	private static Logger logger = FlexLogger.getLogger(StdPAPPolicyTest.class);
+	private Path repository;
+	Properties properties = new Properties();
+	StdPAPPolicy stdPAPPolicy;
+	
+	@Before
+	public void setUp(){
+	
+		repository = Paths.get("src/test/resources/pdps");
+		try {
+			stdPAPPolicy = new StdPAPPolicy();
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+
+	@Test
+	public void testGetActionAttribute(){
+		try {
+			stdPAPPolicy.setActionAttribute("test");
+			assertTrue(stdPAPPolicy.getActionAttribute() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetActionBody(){
+		try {
+			stdPAPPolicy.setActionBody("actionBody");
+			assertTrue(stdPAPPolicy.getActionBody() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetActionDictHeader(){
+		try {
+			stdPAPPolicy.setActionDictHeader("actionDictHeader");
+			assertTrue(stdPAPPolicy.getActionDictHeader() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetActionDictMethod(){
+		try {
+			stdPAPPolicy.setActionDictMethod("actionDictMethod");
+			assertTrue(stdPAPPolicy.getActionDictMethod() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetActionDictType(){
+		try {
+			stdPAPPolicy.setActionDictType("actionDictType");
+			assertTrue(stdPAPPolicy.getActionDictType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetActionDictUrl(){
+		try {
+			stdPAPPolicy.setActionDictUrl("actionDictUrl");
+			assertTrue(stdPAPPolicy.getActionDictUrl() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetActionPerformer(){
+		try {
+			stdPAPPolicy.setActionPerformer("actionPerformer");
+			assertTrue(stdPAPPolicy.getActionPerformer() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetBrmsController(){
+		try {
+			stdPAPPolicy.setBrmsController("brmsController");
+			assertTrue(stdPAPPolicy.getBrmsController() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetBrmsDependency(){
+		try {
+			stdPAPPolicy.setBrmsDependency(new ArrayList());
+			assertTrue(stdPAPPolicy.getBrmsDependency() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetConfigBodyData(){
+		try {
+			stdPAPPolicy.setConfigBodyData("configBodyData");
+			assertTrue(stdPAPPolicy.getConfigBodyData() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+
+	@Test
+	public void testGetConfigName(){
+		try {
+			stdPAPPolicy.setConfigName("configName");
+			assertTrue(stdPAPPolicy.getConfigName() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetConfigPolicyType(){
+		try {
+			stdPAPPolicy.setConfigPolicyType("configPolicyType");
+			assertTrue(stdPAPPolicy.getConfigPolicyType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetConfigType(){
+		try {
+			stdPAPPolicy.setConfigType("configType");
+			assertTrue(stdPAPPolicy.getConfigType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetDataTypeList(){
+		try {
+			stdPAPPolicy.setDataTypeList(new ArrayList<String>());
+			assertTrue(stdPAPPolicy.getDataTypeList() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetDeleteCondition(){
+		try {
+			stdPAPPolicy.setDeleteCondition("deleteCondition");
+			assertTrue(stdPAPPolicy.getDeleteCondition() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	
+	@Test
+	public void testGetDrlRuleAndUIParams(){
+		try {
+			stdPAPPolicy.setDrlRuleAndUIParams(new HashMap());
+			assertTrue(stdPAPPolicy.getDrlRuleAndUIParams() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetDropDownMap(){
+		try {
+			stdPAPPolicy.setDropDownMap(new HashMap());
+			assertTrue(stdPAPPolicy.getDropDownMap() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetDynamicFieldConfigAttributes(){
+		try {
+			assertTrue(stdPAPPolicy.getDynamicFieldConfigAttributes() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetDynamicRuleAlgorithmCombo(){
+		try {
+			stdPAPPolicy.setDynamicRuleAlgorithmCombo(new ArrayList());
+			assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmCombo() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetDynamicRuleAlgorithmField1(){
+		try {
+			stdPAPPolicy.setDynamicRuleAlgorithmField1(new ArrayList());
+			assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmField1() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+
+	@Test
+	public void testGetDictionary(){
+		try {
+			stdPAPPolicy.setDictionary("dictionary");
+			assertTrue(stdPAPPolicy.getDictionary() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetDictionaryFields(){
+		try {
+			stdPAPPolicy.setDictionaryFields("dictionaryFields");
+			assertTrue(stdPAPPolicy.getDictionaryFields() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetDictionaryType(){
+		try {
+			stdPAPPolicy.setDictionaryType("dictionaryType");
+			assertTrue(stdPAPPolicy.getDictionaryType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetDomainDir(){
+		try {
+			stdPAPPolicy.setDomainDir("domain");
+			assertTrue(stdPAPPolicy.getDomainDir() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testIsDraft(){
+		try {
+			stdPAPPolicy.setDraft(true);
+			assertTrue(stdPAPPolicy.isDraft() == true);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetDynamicRuleAlgorithmLabels(){
+		try {
+			stdPAPPolicy.setDynamicRuleAlgorithmLabels(new ArrayList());
+			assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmLabels() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetDynamicSettingsMap(){
+		try {
+			stdPAPPolicy.setDynamicSettingsMap(new HashMap());
+			assertTrue(stdPAPPolicy.getDynamicSettingsMap() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetDynamicVariableList(){
+		try {
+			stdPAPPolicy.setDynamicVariableList(new ArrayList());
+			assertTrue(stdPAPPolicy.getDynamicVariableList() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetGuard(){
+		try {
+			stdPAPPolicy.setGuard("domain");
+			assertTrue(stdPAPPolicy.getGuard() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetHighestVersion(){
+		try {
+			stdPAPPolicy.setHighestVersion(123);
+			assertTrue(stdPAPPolicy.getHighestVersion() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testgGtJsonBody(){
+		try {
+			stdPAPPolicy.setJsonBody("jsonBoby");
+			assertTrue(stdPAPPolicy.getJsonBody() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetLocation(){
+		try {
+			stdPAPPolicy.setLocation(new URI("test"));
+			assertTrue(stdPAPPolicy.getLocation() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetMsLocation(){
+		try {
+			stdPAPPolicy.setMsLocation("MsLocation");
+			assertTrue(stdPAPPolicy.getMsLocation() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testSetOldPolicyFileName(){
+		try {
+			stdPAPPolicy.setOldPolicyFileName("domain");
+			assertTrue(stdPAPPolicy.getOldPolicyFileName() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetOnapName(){
+		try {
+			stdPAPPolicy.setOnapName("onap");
+			assertTrue(stdPAPPolicy.getOnapName() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetPolicyDescription(){
+		try {
+			stdPAPPolicy.setPolicyDescription("description test");
+			assertTrue(stdPAPPolicy.getPolicyDescription() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetPolicyID(){
+		try {
+			stdPAPPolicy.setPolicyID("test");
+			assertTrue(stdPAPPolicy.getPolicyID() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testSetPolicyName(){
+		try {
+			stdPAPPolicy.setPolicyName("MsLocation");
+			assertTrue(stdPAPPolicy.getPolicyName() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testSetPriority(){
+		try {
+			stdPAPPolicy.setPriority("domain");
+			assertTrue(stdPAPPolicy.getPriority() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetProviderComboBox(){
+		try {
+			stdPAPPolicy.setProviderComboBox("onap");
+			assertTrue(stdPAPPolicy.getProviderComboBox() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetRiskLevel(){
+		try {
+			stdPAPPolicy.setRiskLevel("test");
+			assertTrue(stdPAPPolicy.getRiskLevel() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetRiskType(){
+		try {
+			stdPAPPolicy.setRiskType("test");
+			assertTrue(stdPAPPolicy.getRiskType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testGetRuleID(){
+		try {
+			stdPAPPolicy.setRuleID("MsLocation");
+			assertTrue(stdPAPPolicy.getRuleID() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testGetServiceType(){
+		try {
+			stdPAPPolicy.setServiceType("domain");
+			assertTrue(stdPAPPolicy.getServiceType() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+	@Test
+	public void testGetTTLDate(){
+		try {
+			stdPAPPolicy.setTTLDate("09/20/17");
+			assertTrue(stdPAPPolicy.getTTLDate() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+
+	@Test
+	public void testGetUuid(){
+		try {
+			stdPAPPolicy.setUuid("11212122");
+			assertTrue(stdPAPPolicy.getUuid() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}	
+	@Test
+	public void testGetVersion(){
+		try {
+			stdPAPPolicy.setVersion("testv01");
+			assertTrue(stdPAPPolicy.getVersion() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+		
+	}	
+	
+	@Test
+	public void testIsEditPolicy(){
+		try {
+			stdPAPPolicy.setEditPolicy(true);
+			assertTrue(stdPAPPolicy.isEditPolicy() == true);
+		} catch (Exception e) {
+			logger.info(e);
+		}	
+	}	
+	@Test
+	public void testToString(){
+		try {
+			assertTrue(stdPAPPolicy.toString() != null);
+		} catch (Exception e) {
+			logger.info(e);
+		}
+	}
+	
+}
\ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
index a0f1ba8..7c60ecf 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/components/HumanPolicyComponent.java
@@ -202,7 +202,7 @@
 		combiningAlgo2human.put("only-one-applicable", "to honour the result of the first successfully evaluated $placeholder$ in order");
 	}	
 	
-	private Map<String, AttributeIdentifiers> attributeIdentifiersMap = new HashMap<String, AttributeIdentifiers>();
+	private Map<String, AttributeIdentifiers> attributeIdentifiersMap = new HashMap<>();
 	
 	private final StringWriter stringWriter = new StringWriter();
 	private final PrintWriter htmlOut = new PrintWriter(stringWriter);
@@ -357,7 +357,7 @@
 		else
 			policySet(policySet, "li");
 		
-		if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0)
+		if (!policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty())
 			htmlOut.println("<ol>");
 
 		return super.onPreVisitPolicySet(parent, policySet);
@@ -377,7 +377,7 @@
 			LOGGER.trace("PolicySet: " + policySet.getPolicySetId() + 
 					     " Description: " + policySet.getDescription());	
 		
-		if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0)
+		if (!policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty())
 			htmlOut.println("</ol>");
 		
 		htmlOut.println("<p></p>");
@@ -421,7 +421,7 @@
 		}
 		
 		if (policySet.getPolicySetOrPolicyOrPolicySetIdReference() != null &&
-			policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0) {
+			!policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty()) {
 			String algoDesc = combiningAlgo2human.get(combiningAlgorithm);
 			if (algoDesc != null) {
 				algoDesc = algoDesc.replace("$placeholder$", "policy") + " (" + "<i>" + combiningAlgorithm + "</i>)";
@@ -449,7 +449,7 @@
 		
 		policy(policy);
 		
-		if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0)
+		if (!policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty())
 			htmlOut.println("<ol type=\"i\">");
 		
 		return super.onPreVisitPolicy(parent, policy);
@@ -464,7 +464,7 @@
 			LOGGER.trace("PolicySet: " + policy.getPolicyId() + 
 					     "Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion());
 		
-		if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0)
+		if (!policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty())
 			htmlOut.println("</ol>");
 		
 		htmlOut.println("<p></p>");
@@ -506,7 +506,7 @@
 		}
 		
 		if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition() != null &&
-			policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0) {
+			!policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty()) {
 			String algoDesc = combiningAlgo2human.get(combiningAlgorithm);
 			if (algoDesc != null) {
 				algoDesc = algoDesc.replace("$placeholder$", "rule") + " (<i>" + combiningAlgorithm + "</i>)";
@@ -710,7 +710,7 @@
 								//
 								StdAttribute attribute = null;
 								AttributeValueType value = match.getAttributeValue();
-								String attributeDataType = null;
+								String attributeDataType;
 								if (match.getAttributeDesignator() != null && value != null) {
 									AttributeDesignatorType designator = match.getAttributeDesignator();
 									attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
@@ -822,11 +822,12 @@
 	}
 	
 	private String removePrimitives(String in) {
-		in = in.replace("string-", "");
-		in = in.replace("integer-", "");
-		in = in.replace("double-", "");
-		in = in.replace("boolean-", "");
-		return in;
+		String newIn = in;
+		newIn = newIn.replace("string-", "");
+		newIn = newIn.replace("integer-", "");
+		newIn = newIn.replace("double-", "");
+		newIn = newIn.replace("boolean-", "");
+		return newIn;
 	}
 	
 	private String stringifyCondition(ConditionType condition) {
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
index 353e08a..32f40b9 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/conf/HibernateSession.java
@@ -64,4 +64,6 @@
 		logSessionFactory = logSessionFactory1;
 	}
 
+	private HibernateSession(){
+	}
 }
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
index f10041e..392adf0 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateClosedLoopPMController.java
@@ -98,24 +98,24 @@
 										String attributeId = designator.getAttributeId();
 
 										// First match in the target is OnapName, so set that value.
-										if (attributeId.equals("ONAPName")) {
+										if ("ONAPName".equals(attributeId)) {
 											policyAdapter.setOnapName(value);
 										}
-										if (attributeId.equals("RiskType")){
+										if ("RiskType".equals(attributeId)){
 											policyAdapter.setRiskType(value);
 										}
-										if (attributeId.equals("RiskLevel")){
+										if ("RiskLevel".equals(attributeId)){
 											policyAdapter.setRiskLevel(value);
 										}
-										if (attributeId.equals("guard")){
+										if ("guard".equals(attributeId)){
 											policyAdapter.setGuard(value);
 										}
-										if (attributeId.equals("TTLDate") && !value.contains("NA")){
+										if ("TTLDate".equals(attributeId) && !value.contains("NA")){
 											PolicyController controller = new PolicyController();
 											String newDate = controller.convertDate(value);
 											policyAdapter.setTtlDate(newDate);
 										}
-										if (attributeId.equals("ServiceType")){
+										if ("ServiceType".equals(attributeId)){
 											LinkedHashMap<String, String> serviceTypePolicyName1 = new LinkedHashMap<>();
 											String key = "serviceTypePolicyName";
 											serviceTypePolicyName1.put(key, value);
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/LoadedPolicy.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/LoadedPolicy.java
index 25636fb..862b654 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/LoadedPolicy.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/LoadedPolicy.java
@@ -21,37 +21,39 @@
 package org.onap.policy.api;
 
 import java.util.Map;
+
 /**
  * <code>LoadedPolicy</code> defines the Policy that has been Loaded into the PDP. 
- * 
- * @version 0.2 
+ *
+ * @version 0.2
  */
 public interface LoadedPolicy {
-	/**
-	 * Gets the <code>String</code> format of the Policy Name that has been Loaded into the PDP. 
-	 * 
-	 * @return <code>String</code> format of Policy Name
-	 */
-	public String getPolicyName();
-	
-	/**
-	 * Gets the <code>String</code> format of the Policy Version that has been Loaded into the PDP. 
-	 * 
-	 * @return <code>String</code> format of the Policy Version. 
-	 */
-	public String getVersionNo();
-	
-	/**
-	 * Gets the <code>Map</code> of <code>String,String</code> format of the Matches if the policy Loaded is of Config Type. 
-	 * 
-	 * @return the <code>Map</code> of <code>String,String</code> format of the matches in the policy. 
-	 */
-	public Map<String, String> getMatches();
-	
-	/**
-	 * Gets the <code>UpdateType</code> of {@link org.onap.policy.api.UpdateType} received.
-	 * 
-	 * @return <code>UpdateType</code> associated with this <code>PDPNotification</code>
-	 */
-	public UpdateType getUpdateType();
+
+    /**
+     * Gets the <code>String</code> format of the Policy Name that has been Loaded into the PDP.
+     *
+     * @return <code>String</code> format of Policy Name
+     */
+    String getPolicyName();
+
+    /**
+     * Gets the <code>String</code> format of the Policy Version that has been Loaded into the PDP.
+     *
+     * @return <code>String</code> format of the Policy Version.
+     */
+    String getVersionNo();
+
+    /**
+     * Gets the <code>Map</code> of <code>String,String</code> format of the Matches if the policy Loaded is of Config Type.
+     *
+     * @return the <code>Map</code> of <code>String,String</code> format of the matches in the policy.
+     */
+    Map<String, String> getMatches();
+
+    /**
+     * Gets the <code>UpdateType</code> of {@link org.onap.policy.api.UpdateType} received.
+     *
+     * @return <code>UpdateType</code> associated with this <code>PDPNotification</code>
+     */
+    UpdateType getUpdateType();
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationHandler.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationHandler.java
index 837eba9..78b79a0 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationHandler.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationHandler.java
@@ -19,17 +19,20 @@
  */
 
 package org.onap.policy.api;
+
 /**
  * Defines the methods which need to run when an Event or Notification is received.
- *  
+ *
  * @version 0.1
  */
 @FunctionalInterface
 public interface NotificationHandler {
-	/**
-	 * <code>notificationReceived</code> method will be triggered automatically whenever a Notification is received by the PEP.
-	 * 
-	 * @param notification <code>PDPNotification</code> of {@link org.onap.policy.api.PDPNotification} is the object that has information of the notification.
-	 */
-	public void notificationReceived(PDPNotification notification);
+
+    /**
+     * <code>notificationReceived</code> method will be triggered automatically whenever a Notification is received by the PEP.
+     *
+     * @param notification <code>PDPNotification</code> of {@link org.onap.policy.api.PDPNotification}
+     * is the object that has information of the notification.
+     */
+    void notificationReceived(PDPNotification notification);
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationType.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationType.java
index 730ad02..8b65a42 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationType.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationType.java
@@ -23,36 +23,35 @@
 /**
  * Enumeration of the Update Type that has occurred in the <code>PDPNotification</code> of 
  * {@link org.onap.policy.api.PDPNotification}
- * 
+ *
  * @version 0.1
  */
 public enum NotificationType {
-	/**
-	 * Indicates that a policy has been updated
-	 */
-	UPDATE("update"),
-	/**
-	 * Indicates that a policy has been removed
-	 */
-	REMOVE("remove"),
-	/**
-	 * Indicates that both update and removal of policy events has occurred.
-	 */
-	BOTH("both")
-	;
-	
-	private String name;
-	
-	private NotificationType(String name){
-		this.name = name;
-	}
-	
-	/**
-	 * Returns the <code>String</code> format of the Type for this <code>UpdateType</code>
-	 * @return the <code>String</code> Type of <code>UpdateType</code>
-	 */
-	@Override
-	public String toString(){
-		return this.name;
-	}
+    /**
+     * Indicates that a policy has been updated
+     */
+    UPDATE("update"),
+    /**
+     * Indicates that a policy has been removed
+     */
+    REMOVE("remove"),
+    /**
+     * Indicates that both update and removal of policy events has occurred.
+     */
+    BOTH("both");
+
+    private String name;
+
+    NotificationType(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Returns the <code>String</code> format of the Type for this <code>UpdateType</code>
+     * @return the <code>String</code> Type of <code>UpdateType</code>
+     */
+    @Override
+    public String toString() {
+        return this.name;
+    }
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/PDPNotification.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/PDPNotification.java
index a88ec06..9ab5082 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/PDPNotification.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/PDPNotification.java
@@ -24,29 +24,29 @@
 
 /**
  * Defines the <code>Notification</code> event sent from PDP to Client PEP.  
- * 
+ *
  * @version 0.2
  */
 public interface PDPNotification {
-	/**
-	 * Gets the <code>Collection</code> of {@link org.onap.policy.api.RemovedPolicy} objects received. 
-	 * 
-	 * @return the <code>Collection</code> which consists of <code>RemovedPolicy</code> objects.
-	 */
-	public Collection<RemovedPolicy> getRemovedPolicies();
-	
-	/**
-	 * Gets the <code>Collection</code> of {@link org.onap.policy.api.LoadedPolicy} objects receieved.
-	 *
-	 * @return the <code>Collection</code> which consists of <code>UpdatedPolicy</code> objects.
-	 */
-	public Collection<LoadedPolicy> getLoadedPolicies();
-	
-	/**
-	 * Gets the <code>NotificationType</code> of {@link org.onap.policy.api.NotificationType} received.
-	 * 
-	 * @return <code>NotificationType</code> associated with this <code>PDPNotification</code>
-	 */
-	public NotificationType getNotificationType();
-	
+
+    /**
+     * Gets the <code>Collection</code> of {@link org.onap.policy.api.RemovedPolicy} objects received.
+     *
+     * @return the <code>Collection</code> which consists of <code>RemovedPolicy</code> objects.
+     */
+    Collection<RemovedPolicy> getRemovedPolicies();
+
+    /**
+     * Gets the <code>Collection</code> of {@link org.onap.policy.api.LoadedPolicy} objects receieved.
+     *
+     * @return the <code>Collection</code> which consists of <code>UpdatedPolicy</code> objects.
+     */
+    Collection<LoadedPolicy> getLoadedPolicies();
+
+    /**
+     * Gets the <code>NotificationType</code> of {@link org.onap.policy.api.NotificationType} received.
+     *
+     * @return <code>NotificationType</code> associated with this <code>PDPNotification</code>
+     */
+    NotificationType getNotificationType();
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/RemovedPolicy.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/RemovedPolicy.java
index f26c149..e8125a1 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/RemovedPolicy.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/RemovedPolicy.java
@@ -19,23 +19,25 @@
  */
 
 package org.onap.policy.api;
+
 /**
  * <code>RemovedPolicy</code> defines the Policy that has been removed 
- * 
+ *
  * @version 0.1
  */
 public interface RemovedPolicy {
-	/**
-	 * Gets the <code>String</code> format of the Policy Name that has been removed.
-	 * 
-	 * @return <code>String</code> format of Policy Name
-	 */
-	public String getPolicyName();
-	
-	/**
-	 * Gets the <code>String</code> format of the Policy Version that has been removed.
-	 * 
-	 * @return <code>String</code> format of Policy Version
-	 */
-	public String getVersionNo();
+
+    /**
+     * Gets the <code>String</code> format of the Policy Name that has been removed.
+     *
+     * @return <code>String</code> format of Policy Name
+     */
+    String getPolicyName();
+
+    /**
+     * Gets the <code>String</code> format of the Policy Version that has been removed.
+     *
+     * @return <code>String</code> format of Policy Version
+     */
+    String getVersionNo();
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/api/UpdateType.java b/PolicyEngineUtils/src/main/java/org/onap/policy/api/UpdateType.java
index deeecdd..7f401fe 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/api/UpdateType.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/api/UpdateType.java
@@ -23,32 +23,31 @@
 /**
  * Enumeration of the Update Type that has occurred in the <code>UpdatedPolicy</code> of 
  * {@link org.onap.policy.api.LoadedPolicy}
- * 
+ *
  * @version 0.1
  */
 public enum UpdateType {
-	/**
-	 * Indicates that a policy has been updated
-	 */
-	UPDATE("update"),
-	/**
-	 * Indicates that a policy is new
-	 */
-	NEW("new")
-	;
-	
-	private String name;
-	
-	private UpdateType(String name){
-		this.name = name;
-	}
-	
-	/**
-	 * Returns the <code>String</code> format of the Type for this <code>UpdateType</code>
-	 * @return the <code>String</code> Type of <code>UpdateType</code>
-	 */
-	@Override
-	public String toString(){
-		return this.name;
-	}
+    /**
+     * Indicates that a policy has been updated
+     */
+    UPDATE("update"),
+    /**
+     * Indicates that a policy is new
+     */
+    NEW("new");
+
+    private String name;
+
+    UpdateType(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Returns the <code>String</code> format of the Type for this <code>UpdateType</code>
+     * @return the <code>String</code> Type of <code>UpdateType</code>
+     */
+    @Override
+    public String toString() {
+        return this.name;
+    }
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/jpa/BackUpMonitorEntity.java b/PolicyEngineUtils/src/main/java/org/onap/policy/jpa/BackUpMonitorEntity.java
index f2e7f3f..1bfffce 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/jpa/BackUpMonitorEntity.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/jpa/BackUpMonitorEntity.java
@@ -22,7 +22,6 @@
 
 import java.io.Serializable;
 import java.util.Date;
-
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -38,80 +37,81 @@
 
 
 @Entity
-@Table(name="BackUpMonitorEntity")
-@NamedQuery(name="BackUpMonitorEntity.findAll", query= "SELECT b FROM BackUpMonitorEntity b ")
-public class BackUpMonitorEntity implements Serializable{
-	private static final long serialVersionUID = -9190606334322230630L;
-	
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name="id")
-	private int id;
-	
-	@Column(name="node_name", nullable=false)
-	private String resourceNodeName;
-	
-	@Column(name="resource_name", nullable=false, unique=true)
-	private String resourceName;
-	
-	@Column(name="flag", nullable=false)
-	private String flag;
-	
-	@Lob
-	@Column(name="notification_record")
-	private String notificationRecord;
-	
-	@Temporal(TemporalType.TIMESTAMP)
-	@Column(name="last_seen")
-	private Date timeStamp;
-	
-	@PrePersist
-	public void prePersist(){
-		this.timeStamp = new Date();
-	}
-	
-	@PreUpdate
-	public void preUpdate(){
-		this.timeStamp = new Date();
-	}
-	
-	public String getResourceName(){
-		return this.resourceName;
-	}
-	
-	public String getResourceNodeName(){
-		return this.resourceNodeName;
-	}
-	
-	public String getFlag(){
-		return this.flag;
-	}
-	
-	public String getNotificationRecord(){
-		return this.notificationRecord;
-	}
-	
-	public Date getTimeStamp(){
-		return this.timeStamp;
-	}
-	
-	public void setResourceName(String resourceName){
-		this.resourceName = resourceName;
-	}
-	
-	public void setResoruceNodeName(String resourceNodeName){
-		this.resourceNodeName = resourceNodeName;
-	}
-	
-	public void setFlag(String flag){
-		this.flag = flag;
-	}
-	
-	public void setNotificationRecord(String notificationRecord){
-		this.notificationRecord = notificationRecord;
-	}
-	
-	public void setTimeStamp(Date timeStamp){
-		this.timeStamp = timeStamp;
-	}
+@Table(name = "BackUpMonitorEntity")
+@NamedQuery(name = "BackUpMonitorEntity.findAll", query = "SELECT b FROM BackUpMonitorEntity b ")
+public class BackUpMonitorEntity implements Serializable {
+
+    private static final long serialVersionUID = -9190606334322230630L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    @Column(name = "id")
+    private int id;
+
+    @Column(name = "node_name", nullable = false)
+    private String resourceNodeName;
+
+    @Column(name = "resource_name", nullable = false, unique = true)
+    private String resourceName;
+
+    @Column(name = "flag", nullable = false)
+    private String flag;
+
+    @Lob
+    @Column(name = "notification_record")
+    private String notificationRecord;
+
+    @Temporal(TemporalType.TIMESTAMP)
+    @Column(name = "last_seen")
+    private Date timeStamp;
+
+    @PrePersist
+    public void prePersist() {
+        this.timeStamp = new Date();
+    }
+
+    @PreUpdate
+    public void preUpdate() {
+        this.timeStamp = new Date();
+    }
+
+    public String getResourceName() {
+        return this.resourceName;
+    }
+
+    public String getResourceNodeName() {
+        return this.resourceNodeName;
+    }
+
+    public String getFlag() {
+        return this.flag;
+    }
+
+    public String getNotificationRecord() {
+        return this.notificationRecord;
+    }
+
+    public Date getTimeStamp() {
+        return this.timeStamp;
+    }
+
+    public void setResourceName(String resourceName) {
+        this.resourceName = resourceName;
+    }
+
+    public void setResourceNodeName(String resourceNodeName) {
+        this.resourceNodeName = resourceNodeName;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public void setNotificationRecord(String notificationRecord) {
+        this.notificationRecord = notificationRecord;
+    }
+
+    public void setTimeStamp(Date timeStamp) {
+        this.timeStamp = timeStamp;
+    }
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/std/NotificationStore.java b/PolicyEngineUtils/src/main/java/org/onap/policy/std/NotificationStore.java
index 259a70d..8c6c958 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/std/NotificationStore.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/std/NotificationStore.java
@@ -24,7 +24,6 @@
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
-
 import org.onap.policy.api.LoadedPolicy;
 import org.onap.policy.api.NotificationType;
 import org.onap.policy.api.PDPNotification;
@@ -38,229 +37,221 @@
  * 
  */
 public class NotificationStore {
-	private static StdPDPNotification notificationRecord = new StdPDPNotification();
-	
-	public static StdPDPNotification getDeltaNotification(StdPDPNotification newNotification){
-		StdPDPNotification notificationDelta = new StdPDPNotification();
-		ArrayList<StdRemovedPolicy> removedDelta = new ArrayList<>();
-		ArrayList<StdLoadedPolicy> updatedDelta = new ArrayList<>();
-		Collection<StdLoadedPolicy> newUpdatedPolicies = new ArrayList<>();
-		Collection<StdRemovedPolicy> newRemovedPolicies = new ArrayList<>();
-		Collection<LoadedPolicy> oldUpdatedLostPolicies = notificationRecord.getLoadedPolicies();
-		Collection<RemovedPolicy> oldRemovedPolicies = notificationRecord.getRemovedPolicies();
-		Collection<LoadedPolicy> oldUpdatedPolicies = notificationRecord.getLoadedPolicies();
-		Boolean update = false;
-		Boolean remove = false;
-		// if the NotificationRecord is empty
-		if(notificationRecord.getRemovedPolicies()==null || notificationRecord.getLoadedPolicies()==null){
-			if(newNotification!=null){
-				notificationRecord = newNotification;
-			}
-			return notificationDelta;
-		}
-		// do the Delta operation. 
-		if(newNotification!=null){
-			// check for old removed policies.
-			if(!newNotification.getRemovedPolicies().isEmpty()){
-				for(RemovedPolicy newRemovedPolicy: newNotification.getRemovedPolicies()){
-					//Look for policy Not in Remove
-					Boolean removed = true;
-					for(RemovedPolicy oldRemovedPolicy: notificationRecord.getRemovedPolicies()){
-						if(newRemovedPolicy.getPolicyName().equals(oldRemovedPolicy.getPolicyName())){
-							if(newRemovedPolicy.getVersionNo().equals(oldRemovedPolicy.getVersionNo())){
-								removed = false;
-								// Don't want a duplicate. 
-								oldRemovedPolicies.remove(oldRemovedPolicy);
-							}
-						}
-					}
-					//We need to change our record we have an Update record of this remove.  
-					for(LoadedPolicy oldUpdatedPolicy: notificationRecord.getLoadedPolicies()){
-						if(newRemovedPolicy.getPolicyName().equals(oldUpdatedPolicy.getPolicyName())){
-							if(newRemovedPolicy.getVersionNo().equals(oldUpdatedPolicy.getVersionNo())){
-								oldUpdatedPolicies.remove(oldUpdatedPolicy);
-								oldUpdatedLostPolicies.remove(oldUpdatedPolicy);
-							}
-						}
-					}
-					if(removed){
-						remove = true;
-						notificationRecord.getRemovedPolicies().add(newRemovedPolicy);
-						removedDelta.add((StdRemovedPolicy)newRemovedPolicy);
-					}
-					// This will be converted to New Later. 
-					oldRemovedPolicies.add(newRemovedPolicy);
-				}
-			}
-			// Check for old Updated Policies. 
-			if(!newNotification.getLoadedPolicies().isEmpty()){
-				for(LoadedPolicy newUpdatedPolicy: newNotification.getLoadedPolicies()){
-					// Look for policies which are not in Update
-					Boolean updated = true;
-					for(LoadedPolicy oldUpdatedPolicy: notificationRecord.getLoadedPolicies()){
-						if(newUpdatedPolicy.getPolicyName().equals(oldUpdatedPolicy.getPolicyName())){
-							if(newUpdatedPolicy.getVersionNo().equals(oldUpdatedPolicy.getVersionNo())){
-								updated = false;
-								// Remove the policy from copy. 
-								oldUpdatedLostPolicies.remove(oldUpdatedPolicy);
-								// Eliminating Duplicate. 
-								oldUpdatedPolicies.remove(oldUpdatedPolicy);
-							}
-						}
-					}
-					// Change the record if the policy has been Removed earlier. 
-					for(RemovedPolicy oldRemovedPolicy: notificationRecord.getRemovedPolicies()){
-						if(oldRemovedPolicy.getPolicyName().equals(newUpdatedPolicy.getPolicyName())){
-							if(oldRemovedPolicy.getVersionNo().equals(newUpdatedPolicy.getVersionNo())){
-								oldRemovedPolicies.remove(oldRemovedPolicy);
-							}
-						}
-					}
-					if(updated){
-						update = true;
-						updatedDelta.add((StdLoadedPolicy)newUpdatedPolicy);
-					}
-					// This will be converted to new Later
-					oldUpdatedPolicies.add(newUpdatedPolicy);
-				}
-				// Conversion of Update to Remove if that occurred.
-				if(!oldUpdatedLostPolicies.isEmpty()){
-					for(LoadedPolicy updatedPolicy: oldUpdatedLostPolicies){
-						StdRemovedPolicy removedPolicy = new StdRemovedPolicy();
-						removedPolicy.setPolicyName(updatedPolicy.getPolicyName());
-						removedPolicy.setVersionNo(updatedPolicy.getVersionNo());
-						removedDelta.add(removedPolicy);
-						remove = true;
-					}
-				}
-			}
-			// Update our Record. 
-			if(!oldUpdatedPolicies.isEmpty()){
-				for(LoadedPolicy updatedPolicy: oldUpdatedPolicies){
-					newUpdatedPolicies.add((StdLoadedPolicy)updatedPolicy);
-				}
-			}
-			if(!oldRemovedPolicies.isEmpty()){
-				for(RemovedPolicy removedPolicy: oldRemovedPolicies){
-					newRemovedPolicies.add((StdRemovedPolicy)removedPolicy);
-				}
-			}
-			notificationRecord.setRemovedPolicies(newRemovedPolicies);
-			notificationRecord.setLoadedPolicies(newUpdatedPolicies);
-			// Update the notification Result. 
-			notificationDelta.setRemovedPolicies(removedDelta);
-			notificationDelta.setLoadedPolicies(updatedDelta);
-			if(remove&&update){
-				notificationDelta.setNotificationType(NotificationType.BOTH);
-			}else if(remove){
-				notificationDelta.setNotificationType(NotificationType.REMOVE);
-			}else if(update){
-				notificationDelta.setNotificationType(NotificationType.UPDATE);
-			}
-		}
-		return notificationDelta;
-	}
-	
-	public static void recordNotification(StdPDPNotification notification){
-		if(notification!=null){
-			if(notificationRecord.getRemovedPolicies()==null || notificationRecord.getLoadedPolicies()==null){
-				notificationRecord = notification;
-			}else{
-				// Check if there is anything new and update the record. 
-				if(notificationRecord.getLoadedPolicies()!=null || notificationRecord.getRemovedPolicies()!=null){
-					HashSet<StdRemovedPolicy> removedPolicies = new HashSet<>();
-					for(RemovedPolicy rPolicy: notificationRecord.getRemovedPolicies()){
-						StdRemovedPolicy sRPolicy = new StdRemovedPolicy();
-						sRPolicy.setPolicyName(rPolicy.getPolicyName());
-						sRPolicy.setVersionNo(rPolicy.getVersionNo());
-						removedPolicies.add(sRPolicy);
-					}
-					HashSet<StdLoadedPolicy> updatedPolicies = new HashSet<>();
-					for(LoadedPolicy uPolicy: notificationRecord.getLoadedPolicies()){
-						StdLoadedPolicy sUPolicy = new StdLoadedPolicy();
-						sUPolicy.setMatches(uPolicy.getMatches());
-						sUPolicy.setPolicyName(uPolicy.getPolicyName());
-						sUPolicy.setVersionNo(uPolicy.getVersionNo());
-						sUPolicy.setUpdateType(uPolicy.getUpdateType());
-						updatedPolicies.add(sUPolicy);
-					}
-					
-					// Checking with the new updated policies.
-					if(notification.getLoadedPolicies()!=null && !notification.getLoadedPolicies().isEmpty()){
-						for(LoadedPolicy newUpdatedPolicy: notification.getLoadedPolicies()){
-							// If it was removed earlier then we need to remove from our record
-							Iterator<StdRemovedPolicy> oldRemovedPolicy = removedPolicies.iterator();
-							while(oldRemovedPolicy.hasNext()){
-								RemovedPolicy policy = oldRemovedPolicy.next(); 
-								if(newUpdatedPolicy.getPolicyName().equals(policy.getPolicyName())) {
-									if(newUpdatedPolicy.getVersionNo().equals(policy.getVersionNo())) {
-										oldRemovedPolicy.remove();
-									}
-								}
-							}
-							// If it was previously updated need to Overwrite it to the record. 
-							Iterator<StdLoadedPolicy> oldUpdatedPolicy = updatedPolicies.iterator();
-							while(oldUpdatedPolicy.hasNext()){
-								LoadedPolicy policy = oldUpdatedPolicy.next();
-								if(newUpdatedPolicy.getPolicyName().equals(policy.getPolicyName())) {
-									if(newUpdatedPolicy.getVersionNo().equals(policy.getVersionNo())) {
-										oldUpdatedPolicy.remove();
-									}
-								}
-							}
-							StdLoadedPolicy sUPolicy = new StdLoadedPolicy();
-							sUPolicy.setMatches(newUpdatedPolicy.getMatches());
-							sUPolicy.setPolicyName(newUpdatedPolicy.getPolicyName());
-							sUPolicy.setVersionNo(newUpdatedPolicy.getVersionNo());
-							sUPolicy.setUpdateType(newUpdatedPolicy.getUpdateType());
-							updatedPolicies.add(sUPolicy);
-						}
-					}
-					// Checking with New Removed Policies.
-					if(notification.getRemovedPolicies()!=null && !notification.getRemovedPolicies().isEmpty()){
-						for(RemovedPolicy newRemovedPolicy : notification.getRemovedPolicies()){
-							// If it was previously removed Overwrite it to the record. 
-							Iterator<StdRemovedPolicy> oldRemovedPolicy = removedPolicies.iterator();
-							while(oldRemovedPolicy.hasNext()){
-								RemovedPolicy policy = oldRemovedPolicy.next(); 
-								if(newRemovedPolicy.getPolicyName().equals(policy.getPolicyName())) {
-									if(newRemovedPolicy.getVersionNo().equals(policy.getVersionNo())) {
-										oldRemovedPolicy.remove();
-									}
-								}
-							}
-							// If it was added earlier then we need to remove from our record. 
-							Iterator<StdLoadedPolicy> oldUpdatedPolicy = updatedPolicies.iterator();
-							while(oldUpdatedPolicy.hasNext()){
-								LoadedPolicy policy = oldUpdatedPolicy.next();
-								if(newRemovedPolicy.getPolicyName().equals(policy.getPolicyName())) {
-									if(newRemovedPolicy.getVersionNo().equals(policy.getVersionNo())) {
-										oldUpdatedPolicy.remove();
-									}
-								}
-							}
-							StdRemovedPolicy sRPolicy = new StdRemovedPolicy();
-							sRPolicy.setPolicyName(newRemovedPolicy.getPolicyName());
-							sRPolicy.setVersionNo(newRemovedPolicy.getVersionNo());
-							removedPolicies.add(sRPolicy);
-						}
-					}
-					notificationRecord.setRemovedPolicies(removedPolicies);
-					notificationRecord.setLoadedPolicies(updatedPolicies);
-				}
-				if(!notificationRecord.getLoadedPolicies().isEmpty() && !notificationRecord.getRemovedPolicies().isEmpty()){
-					notificationRecord.setNotificationType(NotificationType.BOTH);
-				}else if(!notificationRecord.getLoadedPolicies().isEmpty()){
-					notificationRecord.setNotificationType(NotificationType.UPDATE);
-				}else if(!notificationRecord.getRemovedPolicies().isEmpty()){
-					notificationRecord.setNotificationType(NotificationType.REMOVE);
-				}
-			}
-		}
-	}
-	
-	// This should return the current Notification Record. 
-	public static PDPNotification getNotificationRecord(){
-		return notificationRecord;
-	}
+
+    private static StdPDPNotification notificationRecord = new StdPDPNotification();
+
+    public static StdPDPNotification getDeltaNotification(StdPDPNotification newNotification) {
+        StdPDPNotification notificationDelta = new StdPDPNotification();
+        ArrayList<StdRemovedPolicy> removedDelta = new ArrayList<>();
+        ArrayList<StdLoadedPolicy> updatedDelta = new ArrayList<>();
+        Collection<StdLoadedPolicy> newUpdatedPolicies = new ArrayList<>();
+        Collection<StdRemovedPolicy> newRemovedPolicies = new ArrayList<>();
+        Collection<LoadedPolicy> oldUpdatedLostPolicies = notificationRecord.getLoadedPolicies();
+        Collection<RemovedPolicy> oldRemovedPolicies = notificationRecord.getRemovedPolicies();
+        Collection<LoadedPolicy> oldUpdatedPolicies = notificationRecord.getLoadedPolicies();
+        Boolean update = false;
+        Boolean remove = false;
+        // if the NotificationRecord is empty
+        if (notificationRecord.getRemovedPolicies() == null || notificationRecord.getLoadedPolicies() == null) {
+            if (newNotification != null) {
+                notificationRecord = newNotification;
+            }
+            return notificationDelta;
+        }
+        // do the Delta operation.
+        if (newNotification != null) {
+            // check for old removed policies.
+            if (!newNotification.getRemovedPolicies().isEmpty()) {
+                for (RemovedPolicy newRemovedPolicy : newNotification.getRemovedPolicies()) {
+                    //Look for policy Not in Remove
+                    Boolean removed = true;
+                    String policyName = newRemovedPolicy.getPolicyName();
+                    String ver = newRemovedPolicy.getVersionNo();
+                    for (RemovedPolicy oldRemovedPolicy : notificationRecord.getRemovedPolicies()) {
+                        if (policyName.equals(oldRemovedPolicy.getPolicyName())
+                            && ver.equals(oldRemovedPolicy.getVersionNo())) {
+                            removed = false;
+                            // Don't want a duplicate.
+                            oldRemovedPolicies.remove(oldRemovedPolicy);
+                        }
+                    }
+                    //We need to change our record we have an Update record of this remove.
+                    for (LoadedPolicy oldUpdatedPolicy : notificationRecord.getLoadedPolicies()) {
+                        if (policyName.equals(oldUpdatedPolicy.getPolicyName())
+                            && ver.equals(oldUpdatedPolicy.getVersionNo())) {
+                            oldUpdatedPolicies.remove(oldUpdatedPolicy);
+                            oldUpdatedLostPolicies.remove(oldUpdatedPolicy);
+                        }
+                    }
+                    if (removed) {
+                        remove = true;
+                        notificationRecord.getRemovedPolicies().add(newRemovedPolicy);
+                        removedDelta.add((StdRemovedPolicy) newRemovedPolicy);
+                    }
+                    // This will be converted to New Later.
+                    oldRemovedPolicies.add(newRemovedPolicy);
+                }
+            }
+            // Check for old Updated Policies.
+            if (!newNotification.getLoadedPolicies().isEmpty()) {
+                for (LoadedPolicy newUpdatedPolicy : newNotification.getLoadedPolicies()) {
+                    // Look for policies which are not in Update
+                    Boolean updated = true;
+                    String policyName = newUpdatedPolicy.getPolicyName();
+                    String ver = newUpdatedPolicy.getVersionNo();
+                    for (LoadedPolicy oldUpdatedPolicy : notificationRecord.getLoadedPolicies()) {
+                        if (policyName.equals(oldUpdatedPolicy.getPolicyName())
+                            && ver.equals(oldUpdatedPolicy.getVersionNo())) {
+                            updated = false;
+                            // Remove the policy from copy.
+                            oldUpdatedLostPolicies.remove(oldUpdatedPolicy);
+                            // Eliminating Duplicate.
+                            oldUpdatedPolicies.remove(oldUpdatedPolicy);
+                        }
+                    }
+                    // Change the record if the policy has been Removed earlier.
+                    for (RemovedPolicy oldRemovedPolicy : notificationRecord.getRemovedPolicies()) {
+                        if (oldRemovedPolicy.getPolicyName().equals(policyName)
+                            && oldRemovedPolicy.getVersionNo().equals(ver)) {
+                            oldRemovedPolicies.remove(oldRemovedPolicy);
+                        }
+                    }
+                    if (updated) {
+                        update = true;
+                        updatedDelta.add((StdLoadedPolicy) newUpdatedPolicy);
+                    }
+                    // This will be converted to new Later
+                    oldUpdatedPolicies.add(newUpdatedPolicy);
+                }
+                // Conversion of Update to Remove if that occurred.
+                if (!oldUpdatedLostPolicies.isEmpty()) {
+                    for (LoadedPolicy updatedPolicy : oldUpdatedLostPolicies) {
+                        StdRemovedPolicy removedPolicy = new StdRemovedPolicy();
+                        removedPolicy.setPolicyName(updatedPolicy.getPolicyName());
+                        removedPolicy.setVersionNo(updatedPolicy.getVersionNo());
+                        removedDelta.add(removedPolicy);
+                        remove = true;
+                    }
+                }
+            }
+            // Update our Record.
+            if (!oldUpdatedPolicies.isEmpty()) {
+                for (LoadedPolicy updatedPolicy : oldUpdatedPolicies) {
+                    newUpdatedPolicies.add((StdLoadedPolicy) updatedPolicy);
+                }
+            }
+            if (!oldRemovedPolicies.isEmpty()) {
+                for (RemovedPolicy removedPolicy : oldRemovedPolicies) {
+                    newRemovedPolicies.add((StdRemovedPolicy) removedPolicy);
+                }
+            }
+            notificationRecord.setRemovedPolicies(newRemovedPolicies);
+            notificationRecord.setLoadedPolicies(newUpdatedPolicies);
+            // Update the notification Result.
+            notificationDelta.setRemovedPolicies(removedDelta);
+            notificationDelta.setLoadedPolicies(updatedDelta);
+            if (remove && update) {
+                notificationDelta.setNotificationType(NotificationType.BOTH);
+            } else if (remove) {
+                notificationDelta.setNotificationType(NotificationType.REMOVE);
+            } else if (update) {
+                notificationDelta.setNotificationType(NotificationType.UPDATE);
+            }
+        }
+        return notificationDelta;
+    }
+
+    public static void recordNotification(StdPDPNotification notification) {
+        if (notification != null) {
+            if (notificationRecord.getRemovedPolicies() == null || notificationRecord.getLoadedPolicies() == null) {
+                notificationRecord = notification;
+            } else {
+                // Check if there is anything new and update the record.
+                if (notificationRecord.getLoadedPolicies() != null || notificationRecord.getRemovedPolicies() != null) {
+                    HashSet<StdRemovedPolicy> removedPolicies = new HashSet<>();
+                    for (RemovedPolicy rPolicy : notificationRecord.getRemovedPolicies()) {
+                        StdRemovedPolicy sRPolicy = new StdRemovedPolicy();
+                        sRPolicy.setPolicyName(rPolicy.getPolicyName());
+                        sRPolicy.setVersionNo(rPolicy.getVersionNo());
+                        removedPolicies.add(sRPolicy);
+                    }
+                    HashSet<StdLoadedPolicy> updatedPolicies = new HashSet<>();
+                    for (LoadedPolicy uPolicy : notificationRecord.getLoadedPolicies()) {
+                        StdLoadedPolicy sUPolicy = new StdLoadedPolicy();
+                        sUPolicy.setMatches(uPolicy.getMatches());
+                        sUPolicy.setPolicyName(uPolicy.getPolicyName());
+                        sUPolicy.setVersionNo(uPolicy.getVersionNo());
+                        sUPolicy.setUpdateType(uPolicy.getUpdateType());
+                        updatedPolicies.add(sUPolicy);
+                    }
+
+                    // Checking with the new updated policies.
+                    if (notification.getLoadedPolicies() != null && !notification.getLoadedPolicies().isEmpty()) {
+                        for (LoadedPolicy newUpdatedPolicy : notification.getLoadedPolicies()) {
+                            // If it was removed earlier then we need to remove from our record
+                            Iterator<StdRemovedPolicy> oldRemovedPolicy = removedPolicies.iterator();
+                            String policyName = newUpdatedPolicy.getPolicyName();
+                            String ver = newUpdatedPolicy.getVersionNo();
+                            while (oldRemovedPolicy.hasNext()) {
+                                RemovedPolicy policy = oldRemovedPolicy.next();
+                                if (policyName.equals(policy.getPolicyName())
+                                    && ver.equals(policy.getVersionNo())) {
+                                    oldRemovedPolicy.remove();
+                                }
+                            }
+                            // If it was previously updated need to Overwrite it to the record.
+                            updatedPolicies.removeIf(policy -> policyName.equals(policy.getPolicyName())
+                                && ver.equals(policy.getVersionNo()));
+
+                            StdLoadedPolicy sUPolicy = new StdLoadedPolicy();
+                            sUPolicy.setMatches(newUpdatedPolicy.getMatches());
+                            sUPolicy.setPolicyName(newUpdatedPolicy.getPolicyName());
+                            sUPolicy.setVersionNo(newUpdatedPolicy.getVersionNo());
+                            sUPolicy.setUpdateType(newUpdatedPolicy.getUpdateType());
+                            updatedPolicies.add(sUPolicy);
+                        }
+                    }
+                    // Checking with New Removed Policies.
+                    if (notification.getRemovedPolicies() != null && !notification.getRemovedPolicies().isEmpty()) {
+                        for (RemovedPolicy newRemovedPolicy : notification.getRemovedPolicies()) {
+                            // If it was previously removed Overwrite it to the record.
+                            Iterator<StdRemovedPolicy> oldRemovedPolicy = removedPolicies.iterator();
+                            String policyName = newRemovedPolicy.getPolicyName();
+                            String ver = newRemovedPolicy.getVersionNo();
+                            while (oldRemovedPolicy.hasNext()) {
+                                RemovedPolicy policy = oldRemovedPolicy.next();
+                                if (policyName.equals(policy.getPolicyName())
+                                    && ver.equals(policy.getVersionNo())) {
+                                    oldRemovedPolicy.remove();
+                                }
+                            }
+                            // If it was added earlier then we need to remove from our record.
+                            updatedPolicies.removeIf(policy -> policyName.equals(policy.getPolicyName())
+                                && ver.equals(policy.getVersionNo()));
+
+                            StdRemovedPolicy sRPolicy = new StdRemovedPolicy();
+                            sRPolicy.setPolicyName(policyName);
+                            sRPolicy.setVersionNo(ver);
+                            removedPolicies.add(sRPolicy);
+                        }
+                    }
+                    notificationRecord.setRemovedPolicies(removedPolicies);
+                    notificationRecord.setLoadedPolicies(updatedPolicies);
+                }
+                if (!notificationRecord.getLoadedPolicies().isEmpty() && !notificationRecord.getRemovedPolicies()
+                    .isEmpty()) {
+                    notificationRecord.setNotificationType(NotificationType.BOTH);
+                } else if (!notificationRecord.getLoadedPolicies().isEmpty()) {
+                    notificationRecord.setNotificationType(NotificationType.UPDATE);
+                } else if (!notificationRecord.getRemovedPolicies().isEmpty()) {
+                    notificationRecord.setNotificationType(NotificationType.REMOVE);
+                }
+            }
+        }
+    }
+
+    // This should return the current Notification Record.
+    public static PDPNotification getNotificationRecord() {
+        return notificationRecord;
+    }
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/std/StdPDPNotification.java b/PolicyEngineUtils/src/main/java/org/onap/policy/std/StdPDPNotification.java
index fe78071..1640fe8 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/std/StdPDPNotification.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/std/StdPDPNotification.java
@@ -22,59 +22,53 @@
 
 import java.util.Collection;
 import java.util.HashSet;
-
 import org.onap.policy.api.LoadedPolicy;
 import org.onap.policy.api.NotificationType;
 import org.onap.policy.api.PDPNotification;
 import org.onap.policy.api.RemovedPolicy;
 
-public class StdPDPNotification implements PDPNotification{
-	private Collection<StdRemovedPolicy> removedPolicies = null;
-	private Collection<StdLoadedPolicy> loadedPolicies = null;
-	private Collection<RemovedPolicy> removed = null;
-	private Collection<LoadedPolicy> updated = null;
-	private NotificationType notificationType= null;
-	
-	@Override
-	public Collection<RemovedPolicy> getRemovedPolicies() {
-		removed = new HashSet<RemovedPolicy>();
-		if(removedPolicies!=null){
-			for(RemovedPolicy removedPolicy: removedPolicies){
-				removed.add(removedPolicy);
-			}
-			return this.removed;
-		}else{
-			return null;
-		}
-	}
+public class StdPDPNotification implements PDPNotification {
 
-	@Override
-	public Collection<LoadedPolicy> getLoadedPolicies() {
-		updated = new HashSet<LoadedPolicy>();
-		if(loadedPolicies!=null){
-			for(LoadedPolicy updatedPolicy: loadedPolicies){
-				updated.add(updatedPolicy);
-			}
-			return updated;
-		}else{
-			return null;
-		}
-	}
+    private Collection<StdRemovedPolicy> removedPolicies = null;
+    private Collection<StdLoadedPolicy> loadedPolicies = null;
+    private Collection<RemovedPolicy> removed = null;
+    private Collection<LoadedPolicy> updated = null;
+    private NotificationType notificationType = null;
 
-	@Override
-	public NotificationType getNotificationType() {
-		return notificationType;
-	}
+    @Override
+    public Collection<RemovedPolicy> getRemovedPolicies() {
+        removed = new HashSet<>();
+        if (removedPolicies != null) {
+            removed.addAll(removedPolicies);
+            return this.removed;
+        }
+        return null;
+    }
 
-	public void setNotificationType(NotificationType notificationType){
-		this.notificationType= notificationType;
-	}
-	
-	public void setLoadedPolicies(Collection<StdLoadedPolicy> loadedPolicies) {
-		this.loadedPolicies = loadedPolicies;
-	}
-	
-	public void setRemovedPolicies(Collection<StdRemovedPolicy> removedPolicies) {
-		this.removedPolicies = removedPolicies;
-	}
+    @Override
+    public Collection<LoadedPolicy> getLoadedPolicies() {
+        updated = new HashSet<>();
+        if (loadedPolicies != null) {
+            updated.addAll(loadedPolicies);
+            return updated;
+        }
+        return null;
+    }
+
+    @Override
+    public NotificationType getNotificationType() {
+        return notificationType;
+    }
+
+    public void setNotificationType(NotificationType notificationType) {
+        this.notificationType = notificationType;
+    }
+
+    public void setLoadedPolicies(Collection<StdLoadedPolicy> loadedPolicies) {
+        this.loadedPolicies = loadedPolicies;
+    }
+
+    public void setRemovedPolicies(Collection<StdRemovedPolicy> removedPolicies) {
+        this.removedPolicies = removedPolicies;
+    }
 }
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BackUpMonitor.java b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BackUpMonitor.java
index 3cdb515..9aab2ad 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BackUpMonitor.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/BackUpMonitor.java
@@ -248,7 +248,7 @@
                 // This is New. create an entry as Master.
                 LOGGER.info("Adding resource " + resourceName + " to Database");
                 BackUpMonitorEntity bMEntity = new BackUpMonitorEntity();
-                bMEntity.setResoruceNodeName(resourceNodeName);
+                bMEntity.setResourceNodeName(resourceNodeName);
                 bMEntity.setResourceName(resourceName);
                 bMEntity = setMaster(bMEntity);
                 bMEntity.setTimeStamp(new Date());
@@ -297,7 +297,7 @@
                 } else {
                     // Resource name is null -> No resource with same name.
                     selfEntity = new BackUpMonitorEntity();
-                    selfEntity.setResoruceNodeName(resourceNodeName);
+                    selfEntity.setResourceNodeName(resourceNodeName);
                     selfEntity.setResourceName(resourceName);
                     selfEntity.setTimeStamp(new Date());
                     selfEntity = setSlave(selfEntity);
diff --git a/PolicyEngineUtils/src/test/java/org/onap/policy/utils/test/testBackUpMonitor.java b/PolicyEngineUtils/src/test/java/org/onap/policy/utils/test/testBackUpMonitor.java
index c5187c0..39434a7 100644
--- a/PolicyEngineUtils/src/test/java/org/onap/policy/utils/test/testBackUpMonitor.java
+++ b/PolicyEngineUtils/src/test/java/org/onap/policy/utils/test/testBackUpMonitor.java
@@ -252,7 +252,7 @@
 	    origBM.setFlag("SLAVE");
 	    origBM.setTimeStamp(new Date());
 	    BackUpMonitorEntity bMEntity = new BackUpMonitorEntity();
-        bMEntity.setResoruceNodeName(ResourceNode.BRMS.toString());
+        bMEntity.setResourceNodeName(ResourceNode.BRMS.toString());
         bMEntity.setResourceName("brms_test2");
         bMEntity.setFlag("MASTER");
         bMEntity.setTimeStamp(new Date());        
diff --git a/pom.xml b/pom.xml
index 96cc501..c615114 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.onap.oparent</groupId>
 		<artifactId>oparent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
+		<version>0.1.1</version>
 		<relativePath/>
 	</parent>
 
