title: jsonpath predicate filter not working in java
body: <p>I am using com.jayway.jsonpath 2.2.0 to see if attributes are in a series of JSON records.</p>
  
  <p>Here's an example of a JSON record being used</p>
  
  <pre><code>{
      "data": 
      {
          "sampleTime": "2017-06-02T11:47:37.040Z",
          "target": 
          {
              "gateway": "TEST1",
              "probe": "zeus",
              "managedEntity": "zeus",
              "type": "",
              "sampler": "HARDWARE",
              "dataview": "HARDWARE",
              "filter": 
              {
                  "osType": "Linux",
                  "pluginName": "HARDWARE"
              }
          },
  
          "name": "cpuUtilisation",
          "row": 
          {
              "Value": "50.39 % (average load)"
          }
      },
  
      "operation": "update"
  }
  </code></pre>
  
  <p>So I want to match if osType == 'Linux', see in the above record</p>
  
  <p>I have some code that tries to do this and <em>seems</em> to work</p>
  
  <pre><code>@Test
  public void test_jsonpath_filter_find_match() throws Exception {
  
      // load in json record from file
      String jsonString = FileUtils.readFileToString(new File("resources/geneos-raw.table-cpuutilisation.json"), "UTF-8");
  
      List&lt;Map&lt;String, Object&gt;&gt; match  = JsonPath.parse(jsonString).read("$..filter", Filter.filter(Criteria.where("osType").eq("Linux")));
  
      System.out.println("result&gt;" + match);
  }
  </code></pre>
  
  <p>I get result printed that seems to prove the JSON record matches the filter</p>
  
  <pre><code>2017/06/03 09:01:27.216 [DEBUG][com.jayway.jsonpath.internal.path.CompiledPath]: Evaluating path: $..['filter']
  result&gt;[{"osType":"Linux","pluginName":"HARDWARE"}]
  </code></pre>
  
  <p>However, if I put a non-matching filter I still get the same result.</p>
  
  <p>Note the osType == 'Windows' in the filter</p>
  
  <pre><code>@Test
  public void test_jsonpath_filter_find_match() throws Exception {
  
      // load in json record from file
      String jsonString = FileUtils.readFileToString(new File("resources/geneos-raw.table-cpuutilisation.json"), "UTF-8");
  
      List&lt;Map&lt;String, Object&gt;&gt; match  = JsonPath.parse(jsonString).read("$..filter", Filter.filter(Criteria.where("osType").eq("Windows")));
  
      System.out.println("result&gt;" + match);
  }
  </code></pre>
  
  <p>And the result is a match!</p>
  
  <pre><code>2017/06/03 09:02:06.137 [DEBUG][com.jayway.jsonpath.internal.path.CompiledPath]: Evaluating path: $..['filter']
  result&gt;[{"osType":"Linux","pluginName":"HARDWARE"}]
  </code></pre>
  
  <p>I believe the result should have been an empty List returned.</p>
  
  <p>Is this a bug, or is there a flaw in my code/thinking?</p>