diff --git a/feature-mdc-filters/pom.xml b/feature-mdc-filters/pom.xml
index 8d6af4b..c3cd4ed 100755
--- a/feature-mdc-filters/pom.xml
+++ b/feature-mdc-filters/pom.xml
@@ -7,9 +7,9 @@
   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.
@@ -87,33 +87,39 @@
     </build>
 
     <dependencies>
-        
+
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>policy-endpoints</artifactId>
             <version>${policy.common.version}</version>
             <scope>provided</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.onap.policy.drools-pdp</groupId>
             <artifactId>policy-management</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
-        
+
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
             <version>2.13.0</version>
             <scope>test</scope>
         </dependency>
-        
+
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-    
+
     </dependencies>
 </project>
diff --git a/feature-mdc-filters/src/main/java/org/onap/policy/drools/mdc/filters/MdcTopicFilter.java b/feature-mdc-filters/src/main/java/org/onap/policy/drools/mdc/filters/MdcTopicFilter.java
index d0813a9..7aa0a92 100755
--- a/feature-mdc-filters/src/main/java/org/onap/policy/drools/mdc/filters/MdcTopicFilter.java
+++ b/feature-mdc-filters/src/main/java/org/onap/policy/drools/mdc/filters/MdcTopicFilter.java
@@ -20,11 +20,13 @@
 
 package org.onap.policy.drools.mdc.filters;
 
+import com.att.aft.dme2.internal.apache.commons.lang3.StringUtils;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import lombok.Getter;
 import org.onap.policy.drools.protocol.coders.JsonProtocolFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,6 +40,7 @@
 
     private Map<String, FilterRule> rules = new HashMap<>();
 
+    @Getter
     public static class FilterRule {
         private String mdcKey;
         private List<String> paths;
@@ -58,37 +61,29 @@
             this.paths = paths;
         }
 
-        public String getMdcKey() {
-            return mdcKey;
-        }
-
-        public List<String> getPaths() {
-            return paths;
-        }
-
         protected void setMdcKey(String mdcKey) {
-            if (mdcKey == null || mdcKey.isEmpty()) {
+            if (StringUtils.isBlank(mdcKey)) {
                 throw new IllegalArgumentException(MDC_KEY_ERROR);
             }
             this.mdcKey = mdcKey;
         }
 
         protected void setPaths(List<String> paths) {
-            if (paths == null || paths.isEmpty()) {
+            if (nullOrEmpty(paths)) {
                 throw new IllegalArgumentException(JSON_PATH_ERROR);
             }
             this.paths = paths;
         }
 
         protected void addPaths(List<String> paths) {
-            if (paths == null || paths.isEmpty()) {
+            if (nullOrEmpty(paths)) {
                 throw new IllegalArgumentException(JSON_PATH_ERROR);
             }
             this.paths.addAll(paths);
         }
 
         protected void addPath(String path) {
-            if (path == null || path.isEmpty()) {
+            if (StringUtils.isBlank(path)) {
                 throw new IllegalArgumentException(JSON_PATH_ERROR);
             }
             this.paths.add(path);
@@ -130,7 +125,7 @@
      * @return the filter rule associated with the key
      */
     protected FilterRule getFilterRule(String mdcKey) {
-        if (mdcKey == null || mdcKey.isEmpty()) {
+        if (StringUtils.isBlank(mdcKey)) {
             throw new IllegalArgumentException(MDC_KEY_ERROR);
         }
         return rules.get(mdcKey);
@@ -144,7 +139,7 @@
      * @return the filter rule that was added for the topic
      */
     protected FilterRule addFilterRule(String mdcKey, String path) {
-        if (path == null || path.isEmpty()) {
+        if (StringUtils.isBlank(path)) {
             throw new IllegalArgumentException(JSON_PATH_ERROR);
         }
         return addFilterRule(mdcKey, Arrays.asList(path));
@@ -158,11 +153,11 @@
      * @return the filter rule that was added for the topic
      */
     protected FilterRule addFilterRule(String mdcKey, List<String> paths) {
-        if (mdcKey == null || mdcKey.isEmpty()) {
+        if (StringUtils.isBlank(mdcKey)) {
             throw new IllegalArgumentException(MDC_KEY_ERROR);
         }
 
-        if (paths == null || paths.isEmpty()) {
+        if (nullOrEmpty(paths)) {
             throw new IllegalArgumentException(JSON_PATH_ERROR);
         }
 
@@ -175,6 +170,10 @@
         return rule;
     }
 
+    private static boolean nullOrEmpty(List<String> paths) {
+        return paths == null || paths.isEmpty();
+    }
+
     /**
      * Modifies an existing filter rule by adding the specified path.
      *
@@ -183,7 +182,7 @@
      * @return the filter rule that was modified
      */
     protected FilterRule modifyFilterRule(String mdcKey, String path) {
-        if (path == null || path.isEmpty()) {
+        if (StringUtils.isBlank(path)) {
             throw new IllegalArgumentException(JSON_PATH_ERROR);
         }
         return modifyFilterRule(mdcKey, Arrays.asList(path));
@@ -197,11 +196,11 @@
      * @return the filter rule that was modified
      */
     protected FilterRule modifyFilterRule(String mdcKey, List<String> paths) {
-        if (mdcKey == null || mdcKey.isEmpty()) {
+        if (StringUtils.isBlank(mdcKey)) {
             throw new IllegalArgumentException(MDC_KEY_ERROR);
         }
 
-        if (paths == null || paths.isEmpty()) {
+        if (nullOrEmpty(paths)) {
             throw new IllegalArgumentException(JSON_PATH_ERROR);
         }
 
@@ -224,18 +223,18 @@
      * @return the filter rule that was modified
      */
     protected FilterRule modifyFilterRule(String oldMdcKey, String newMdcKey, List<String> paths) {
-        if (oldMdcKey == null || oldMdcKey.isEmpty()) {
+        if (StringUtils.isBlank(oldMdcKey)) {
             throw new IllegalArgumentException("current mdcKey must be provided");
         }
 
-        if (newMdcKey == null || newMdcKey.isEmpty()) {
+        if (StringUtils.isBlank(newMdcKey)) {
             throw new IllegalArgumentException("new mdcKey must be provided");
         }
 
         if (oldMdcKey.equals(newMdcKey)) {
             throw new IllegalArgumentException("the old and new mdcKey are equivalent");
         }
-        if (paths == null || paths.isEmpty()) {
+        if (nullOrEmpty(paths)) {
             throw new IllegalArgumentException(JSON_PATH_ERROR);
         }
 
@@ -268,7 +267,7 @@
      * @return the filter rule that was deleted
      */
     protected FilterRule deleteFilterRule(String mdcKey) {
-        if (mdcKey == null || mdcKey.isEmpty()) {
+        if (StringUtils.isBlank(mdcKey)) {
             throw new IllegalArgumentException(MDC_KEY_ERROR);
         }
         return rules.remove(mdcKey);
diff --git a/feature-mdc-filters/src/test/java/org/onap/policy/drools/mdc/filters/MdcTopicFilterTest.java b/feature-mdc-filters/src/test/java/org/onap/policy/drools/mdc/filters/MdcTopicFilterTest.java
index 2a5a875..568a316 100755
--- a/feature-mdc-filters/src/test/java/org/onap/policy/drools/mdc/filters/MdcTopicFilterTest.java
+++ b/feature-mdc-filters/src/test/java/org/onap/policy/drools/mdc/filters/MdcTopicFilterTest.java
@@ -7,9 +7,9 @@
  * 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.
@@ -20,13 +20,16 @@
 
 package org.onap.policy.drools.mdc.filters;
 
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-
 import org.junit.Test;
 import org.onap.policy.drools.mdc.filters.MdcTopicFilter.FilterRule;
 
@@ -83,7 +86,7 @@
      */
     @Test
     public void multiFilterMultiPathTest() {
-        String topicFilterProp = "requestID=$.requestID|$.body.request-id," 
+        String topicFilterProp = "requestID=$.requestID|$.body.request-id,"
                 + "closedLoopControlName=$.closedLoopControlName"
                 + "|$.body.closedLoopControlName";
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
@@ -195,7 +198,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.addFilterRule(null, "$.subRequestID");
     }
-    
+
     /**
      * Tests throwing an exception for passing a null key and a list
      * of paths.
@@ -217,7 +220,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.addFilterRule("", "$.subRequestID");
     }
-    
+
     /**
      * Tests throwing an exception for passing an empty key and
      * a list of paths.
@@ -259,7 +262,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.addFilterRule("requestID", "$.test");
     }
-    
+
     /**
      * Tests throwing an exception for trying to add a filter with a key that
      * already exists with a list of filters.
@@ -271,6 +274,12 @@
         topicFilter.addFilterRule("requestID", Arrays.asList("$.test"));
     }
 
+    @Test
+    public void createFilterRuleExceptionTest() {
+        assertThatIllegalArgumentException().isThrownBy(() -> new MdcTopicFilter("invalid filter"))
+                        .withMessage("could not parse filter rule");
+    }
+
     /**
      * Tests modifying a filter rule to add a new path.
      */
@@ -300,6 +309,14 @@
                 rule.getPaths());
     }
 
+    @Test
+    public void modifyFilterRuleMultiPathExceptionTest() {
+        MdcTopicFilter filter = new MdcTopicFilter("abc=$a.value");
+        assertThatIllegalArgumentException()
+                        .isThrownBy(() -> filter.modifyFilterRule("def", "abc", Arrays.asList("$.b", "$.c")))
+                        .withMessage("a filter rule already exists for key: abc");
+    }
+
     /**
      * Tests modifying a filter rule key.
      */
@@ -324,7 +341,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule(null, "$.request-id");
     }
-    
+
     /**
      * Tests throwing an exception when passing a null key and
      * a list of multiple paths.
@@ -335,7 +352,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule(null, Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty key and
      * a single path.
@@ -346,7 +363,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("", "$.request-id");
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty key and
      * a list of multiple paths.
@@ -357,7 +374,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("", Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty string path.
      */
@@ -367,7 +384,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("requestID", "");
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty list of paths.
      */
@@ -377,9 +394,9 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("requestID", Arrays.asList());
     }
-    
+
     /**
-     * Tests throwing an exception when passing a key that is 
+     * Tests throwing an exception when passing a key that is
      * not in the filter rules map and a string path.
      */
     @Test(expected = IllegalArgumentException.class)
@@ -388,9 +405,9 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("request-id", "$.request-id");
     }
-    
+
     /**
-     * Tests throwing an exception when passing a key that is 
+     * Tests throwing an exception when passing a key that is
      * not in the filter rules map and a list of paths.
      */
     @Test(expected = IllegalArgumentException.class)
@@ -399,8 +416,8 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("request-id", Arrays.asList("$.request-id"));
     }
-    
-    
+
+
     /**
      * Tests throwing an exception when passing a null oldKey.
      */
@@ -410,7 +427,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule(null, "request-id", Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty oldKey.
      */
@@ -420,7 +437,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("", "request-id", Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing a null newKey.
      */
@@ -430,7 +447,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("requestID", null, Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty newKey.
      */
@@ -440,7 +457,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("requestID", "", Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when the old and new key are the same.
      */
@@ -451,7 +468,7 @@
         topicFilter.modifyFilterRule("requestID", "requestID",
                 Arrays.asList("$.request-id"));
     }
-    
+
     /**
      * Tests throwing an exception when passing an empty paths list.
      */
@@ -461,7 +478,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.modifyFilterRule("requestID", "request-id", Arrays.asList());
     }
-    
+
     /**
      * Tests throwing an exception when the old key doesn't exist
      * in the rules map.
@@ -511,7 +528,7 @@
         MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
         topicFilter.deleteFilterRule(null);
     }
-    
+
     /**
      * Tests throwing an exception if the key is empty.
      */
@@ -544,6 +561,19 @@
         assertEquals("update", results.get("operation").get(0));
     }
 
+    @Test
+    public void findAllNotFoundTest() {
+        String message = "{\"requestID\":\"38adde30-cc22-11e8-a8d5-f2801f1b9fd1\",\"entity\":\"controller\","
+                        + "\"controllers\":[{\"name\":\"test-controller\","
+                        + "\"drools\":{\"groupId\":\"org.onap.policy.drools.test\","
+                        + "\"artifactId\":\"test\",\"version\":\"0.0.1\"},\"operation\":\"update\"}]}";
+
+        String topicFilterProp = "requestID=$.requestID[3]";
+        MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
+
+        assertTrue(topicFilter.find(message).get("requestID").isEmpty());
+    }
+
     /**
      * Tests finding field matches for a filter rule corresponding to a topic.
      */
@@ -561,4 +591,71 @@
         List<String> results = topicFilter.find(message, "requestID");
         assertEquals("38adde30-cc22-11e8-a8d5-f2801f1b9fd1", results.get(0));
     }
+
+    @Test
+    public void findNotFoundTest() {
+        String message = "{\"requestID\":\"38adde30-cc22-11e8-a8d5-f2801f1b9fd1\",\"entity\":\"controller\","
+                + "\"controllers\":[{\"name\":\"test-controller\","
+                + "\"drools\":{\"groupId\":\"org.onap.policy.drools.test\","
+                + "\"artifactId\":\"test\",\"version\":\"0.0.1\"},\"operation\":\"update\"}]}";
+
+        String topicFilterProp = "requestID=$.requestID[3]";
+        MdcTopicFilter topicFilter = new MdcTopicFilter(topicFilterProp);
+
+        assertTrue(topicFilter.find(message, "requestID").isEmpty());
+    }
+
+    @Test
+    public void testFilterRuleStringString() {
+        FilterRule rule = new FilterRule("hello", "world");
+
+        assertEquals("hello", rule.getMdcKey());
+        assertEquals("[world]", rule.getPaths().toString());
+    }
+
+    @Test
+    public void testFilterRuleMdcKey() {
+        FilterRule rule = new FilterRule("abc", "def");
+
+        // check error cases first
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.setMdcKey(null))
+                        .withMessage(MdcTopicFilter.MDC_KEY_ERROR);
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.setMdcKey(""))
+                        .withMessage(MdcTopicFilter.MDC_KEY_ERROR);
+
+        // success cases
+        rule.setMdcKey("my-mdc-key");
+        assertEquals("my-mdc-key", rule.getMdcKey());
+    }
+
+    @Test
+    public void testFilterRulePaths() {
+        FilterRule rule = new FilterRule("abc", "def");
+
+        // check error cases first
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.setPaths(null))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.setPaths(Collections.emptyList()))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.addPaths(null))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.addPaths(Collections.emptyList()))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.addPath(null))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+        assertThatIllegalArgumentException().isThrownBy(() -> rule.addPath(""))
+                        .withMessage(MdcTopicFilter.JSON_PATH_ERROR);
+
+        // success cases
+        rule.setPaths(new ArrayList<>(Arrays.asList("pathA", "pathB")));
+        assertEquals("[pathA, pathB]", rule.getPaths().toString());
+
+        rule.addPath("pathC");
+        assertEquals("[pathA, pathB, pathC]", rule.getPaths().toString());
+
+        rule.addPaths(Arrays.asList("pathD", "pathE"));
+        assertEquals("[pathA, pathB, pathC, pathD, pathE]", rule.getPaths().toString());
+    }
 }
