@Test
public void testGetFeatureReaderQuery() throws Exception {

    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
    PropertyName property = ff.property("sample/measurement[1]/parameter");
    Literal literal = ff.literal("ph");
    Filter filterParameter = ff.equals(property, literal);
    property = ff.property("sample/measurement[1]/value");
    literal = ff.literal(new Integer(3));
    Filter filterValue = ff.equals(property, literal);
    Filter filter = ff.and(filterParameter, filterValue);
    FeatureSource<FeatureType, Feature> complexSource = dataStore.getFeatureSource(targetName);
    FeatureCollection<FeatureType, Feature> features = complexSource.getFeatures(filter);
    FeatureIterator<Feature> reader = features.features();
    PropertyIsEqualTo equivalentSourceFilter = ff.equals(ff.property("ph"), ff
            .literal(new Integer(3)));
    FeatureCollection<?,?> collection = mapping.getSource()
            .getFeatures(equivalentSourceFilter);
    int count = 0;
    int expectedCount = collection.size();
    Filter badFilter = ff.greater(ff.property("sample/measurement[1]/value"), ff
            .literal(new Integer(3)));
    while (reader.hasNext()) {
        Feature f = (Feature) reader.next();
        assertNotNull(f);
        assertTrue(filter.evaluate(f));
        assertFalse(badFilter.evaluate(f));
        count++;
    }
    reader.close();
    assertEquals(expectedCount, count);
}