test_class.file: netflix-infix/src/test/java/com/netflix/infix/PathValueEventFilterTest.java
test_class.identifier: PathValueEventFilterTest
test_case.body: @Test
  	public void testPositiveSelection() {
  		MockRequestTrace requestTrace = Mockito.mock(MockRequestTrace.class);
  		
  		when(requestTrace.getClientInfoHostName()).thenReturn("localhost");
  		
  		Map<String, Object> clientInfoMap = Maps.newHashMap();
  		clientInfoMap.put("clientName", "client");
  		clientInfoMap.put("clientId", (long) 10);
  		when(requestTrace.getClientInfoMap()).thenReturn(clientInfoMap);
  		
  		// Test numerical values can be filtered
  		Predicate<Object> filter = new PathValueEventFilter("//clientInfoMap/clientId", new NumericValuePredicate(5, ">"));
  		assertTrue("Filter should return true as the client ID is 10, greater than 5", filter.apply(requestTrace));
  		
  		// Test string value can be filtered
  		filter = new PathValueEventFilter("//clientInfoMap/clientName", new StringValuePredicate("client"));
  		assertTrue("Filter should return true as client name is 'client'", filter.apply(requestTrace));
  		
  		// Test attribute is supported
  		filter = new PathValueEventFilter("//@clientInfoHostName", new StringValuePredicate("localhost"));
  		assertTrue("Filter should return tre as clientInfoHostName is localhost", filter.apply(requestTrace));
  	}
test_case.class_method_signature: PathValueEventFilterTest.testPositiveSelection()
test_case.full_signature: @Test public void testPositiveSelection()
test_case.identifier: testPositiveSelection
test_case.invocations: mock thenReturn when getClientInfoHostName newHashMap put put thenReturn when getClientInfoMap assertTrue apply assertTrue apply assertTrue apply
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPositiveSelection()
focal_class.declarator: xpath
focal_class.modifier: private
focal_class.original_string: private String xpath;
focal_class.type: String
focal_class.var_name: xpath
focal_class.declarator: predicate
focal_class.modifier: private
focal_class.original_string: private ValuePredicate<T> predicate;
focal_class.type: ValuePredicate<T>
focal_class.var_name: predicate
focal_class.file: netflix-infix/src/main/java/com/netflix/infix/PathValueEventFilter.java
focal_class.identifier: PathValueEventFilter
focal_class.interfaces: implements Predicate<T>
focal_class.class_method_signature: PathValueEventFilter.PathValueEventFilter(String path, ValuePredicate<T> predicate)
focal_class.full_signature: public  PathValueEventFilter(String path, ValuePredicate<T> predicate)
focal_class.identifier: PathValueEventFilter
focal_class.modifiers: public
focal_class.parameters: (String path, ValuePredicate<T> predicate)
focal_class.signature:  PathValueEventFilter(String path, ValuePredicate<T> predicate)
focal_class.class_method_signature: PathValueEventFilter.apply(Object input)
focal_class.full_signature: @Override public boolean apply(Object input)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (Object input)
focal_class.return: boolean
focal_class.signature: boolean apply(Object input)
focal_class.class_method_signature: PathValueEventFilter.getXpath()
focal_class.full_signature: public String getXpath()
focal_class.identifier: getXpath
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getXpath()
focal_class.class_method_signature: PathValueEventFilter.getPredicate()
focal_class.full_signature: public ValuePredicate<?> getPredicate()
focal_class.identifier: getPredicate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ValuePredicate<?>
focal_class.signature: ValuePredicate<?> getPredicate()
focal_class.class_method_signature: PathValueEventFilter.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: PathValueEventFilter.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: PathValueEventFilter.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_method.body: @Override
      public boolean apply(Object input) {
          JXPathContext jxpath = JXPathContext.newContext(input);
          // We should allow non-existing path, and let predicate handle it. 
          jxpath.setLenient(true);
          
          @SuppressWarnings("unchecked")
          T value = (T)jxpath.getValue(xpath);
         
          return predicate.apply(value);
      }
focal_method.class_method_signature: PathValueEventFilter.apply(Object input)
focal_method.full_signature: @Override public boolean apply(Object input)
focal_method.identifier: apply
focal_method.invocations: newContext setLenient getValue apply
focal_method.modifiers: @Override public
focal_method.parameters: (Object input)
focal_method.return: boolean
focal_method.signature: boolean apply(Object input)