static boolean viewMatchesSelector(View view,List<Integer> filteringScope){
  if (filteringScope.isEmpty()) {
    return true;
  }
  if (filteringScope.size() == 1) {
    return view.getId() == filteringScope.get(0);
  }
  List<Integer> newScope=new ArrayList<>(filteringScope);
  newScope.remove(newScope.get(newScope.size() - 1));
  return view.getParent() != null && viewMatchesSelector((View)view.getParent(),newScope);
}

static boolean viewMatchesSelector ( View view , List < Integer > filteringScope ) { if ( filteringScope . isEmpty ( ) ) { return true ; } if ( filteringScope . size ( ) == 1 ) { return view . getId ( ) == filteringScope . get ( 0 ) ; } List < Integer > newScope = new ArrayList < > ( filteringScope ) ; newScope . remove ( newScope . get ( newScope . size ( ) - 1 ) ) ; return view . getParent ( ) != null && viewMatchesSelector ( ( View ) view . getParent ( ) , newScope ) ; }
returns whether the provided view matches the list of query selectors . search is performed by traversing the list of filters backwards and trying to match its id to any of the view ' s parents until there are no more filters or views available .
