Matcher matcher = createMatcher();
Object person = createPerson1();
final List<Object[]> result = new ArrayList<Object[]>();
FilterSubscription filterSubscription = matcher.registerFilter(queryString, new FilterCallback() {
@Override
public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
result.add(projection);
}
});
assertNotNull(filterSubscription.getProjection());
assertEquals(3, filterSubscription.getProjection().length);
assertEquals("name", filterSubscription.getProjection()[0]);
assertEquals("name", filterSubscription.getProjection()[1]);
assertEquals("address.postCode", filterSubscription.getProjection()[2]);
matcher.match(person);
matcher.unregisterFilter(filterSubscription);