// find the rightmost selector, this must be a GeneralSelector
Selector selRightmost = r.selector;
while (selRightmost instanceof ChildOrParentSelector) {
selRightmost = ((ChildOrParentSelector) selRightmost).right;
}
OptimizedGeneralSelector s = (OptimizedGeneralSelector) selRightmost;
if (s.conds == null) {
remaining.add(r);
continue;
}
List<SimpleKeyValueCondition> sk = new ArrayList<>(Utils.filteredCollection(s.conds, SimpleKeyValueCondition.class));