Reflectively invokes a {@link ParentRunner}'s getFilteredChildren method. Manipulating this
list lets us control which tests will be run.
482230
static <T> List<T> getFilteredChildren(ParentRunner<T> parentRunner) {
    try {
      //noinspection unchecked
      return new ArrayList<>((Collection<T>) getFilteredChildrenMethod.invoke(parentRunner));
    } catch (IllegalAccessException | InvocationTargetException e) {
      throw new RuntimeException("Failed to invoke getFilteredChildren()", e);
    }
  }
610164
@Override
	protected Statement childrenInvoker(final RunNotifier notifier) {
		return new Statement() {
			@Override
			public void evaluate() {
				JUnitScenarioReporter junitReporter = new JUnitScenarioReporter(
				notifier, numberOfTestCases, rootDescription, configuration.keywords());
				// tell the reporter how to handle pending steps
				junitReporter.usePendingStepStrategy(configuration
						.pendingStepStrategy());

				addToStoryReporterFormats(junitReporter);

				configurableEmbedder.run();
			}
		};
	}
1015985
@Override
	public RunResult invoke(Object forkTestSet)
			throws TestSetFailedException, ReporterException, InvocationTargetException {
		if (forkTestSet == null) {
			RunResult r = RunResult.noTestsRun();
			@SuppressWarnings("rawtypes")
			Iterable<Class<?>> i = getSuites();
			for (Class<?> c : i) {
				r = r.aggregate(invoke(c));
			}
			return r;
		}
		ReporterFactory reporterFactory = providerParameters.getReporterFactory();

		ConsoleStream consoleLogger = providerParameters.getConsoleLogger();
		RunListener rl = reporterFactory.createReporter();

		if (!(forkTestSet instanceof Class)) {
			throw new TestSetFailedException("Unexpected error. Received parameter is not a class");
		}
		@SuppressWarnings("unchecked")
		Class<T> underTest = (Class<T>) forkTestSet;
		TestResultListener<T> listener = new PowerUnitProviderListener<>(consoleLogger, rl, underTest);

		DefaultPowerUnitRunnerImpl<T> runner = new DefaultPowerUnitRunnerImpl<>(underTest);
		runner.addListener(listener);
		runner.run();
		return reporterFactory.close();

	}
832771
public FoundNode[] filterInstanceToLeaves(Instance inst,
            SplitNode parent, int parentBranch, boolean updateSplitterCounts) {
        List<FoundNode> nodes = new LinkedList<FoundNode>();
        ((NewNode) this.treeRoot).filterInstanceToLeaves(inst, parent, parentBranch, nodes,
                updateSplitterCounts);
        return nodes.toArray(new FoundNode[nodes.size()]);
    }
864759
public <T extends Widget & Checkable> List<T> getCheckableChildren() {
        List<Widget> children = getChildren();
        ArrayList<T> result = new ArrayList<>();
        for (Widget c : children) {
            if (c instanceof Checkable) {
                result.add((T) c);
            }
        }
        return result;
    }
833288
public RootMethodRunResult getRunResultByRootMethod(TestMethod rootMethod) {
        if (rootMethod == null) {
            throw new NullPointerException();
        }
        return getRunResultByRootMethodKey(rootMethod.getKey());
    }
581731
function(filter){
      filter = filter || this.filter;

      var cursor = this.cursor_;
      var prevSibling = this.c; // previous sibling
      var prevChild = this.d;   // previous child

      do
      {
        var node = cursor ? cursor[prevSibling] : this.root_[prevChild];
        if (node)
        {
          while (node[prevChild])
            node = node[prevChild];
          cursor = node;
        }
        else
          if (cursor)
            cursor = cursor[PARENT_NODE];

        if (!cursor || cursor === this.root_)
        {
          cursor = null;
          break;
        }
      }
      while (!filter(cursor));

      return this.cursor_ = cursor;
    }
1156499
public Collection<Theme> getChildThemes(ThemeFilter filter) {
        filter = (filter != null) ? filter : new ThemeFilter();

        filter.parent.clear();
        filter.parent.add(this);
        return getInstance().get().themes(filter);
    }
1336379
private static List<Method> getAnnotatedMethodsFromChildToParent(Class<?> clazz, Class<? extends Annotation> annotation,
      Logger log) {
    List<Method> methodsToRun = new ArrayList<Method>();
    while(clazz != null) {
      List<Method> newMethods = getMethodsWithAnnotation(clazz, annotation, log);
      for(Method newMethod : newMethods) {
        if(containsMethod(newMethod, methodsToRun)) {
          removeMethodByName(newMethod, methodsToRun);
        } else {
          methodsToRun.add(newMethod);
        }
      }
      clazz = clazz.getSuperclass();
      if(clazz != null && clazz.equals(Object.class)) {
        clazz = null;
      }
    }
    return methodsToRun;
  }
1158632
public List<FilterDefinition> getFilters() {
		try {
			if (isStarted()) {
				final FilterAcknowledger acknowledger = new FilterAcknowledger();
				
				// Be sure that the emit/ack is synchronous to get the filters before the test are run
				new Thread(new Runnable() {
					@Override
					public void run() {
						try {
							LOGGER.finest("Retrieve filters");
							socket.emit("filters:get", acknowledger);
						}
						catch (Exception e) {
							LOGGER.finest("Unable to get the filters: " + e.getMessage());
							synchronized (acknowledger) {
								acknowledger.notify();
							}
						}
					}
				}).start();

				synchronized (acknowledger) {
					acknowledger.wait();
				}

				if (!acknowledger.hasFilters()) {
					for (FilterDefinition filter : acknowledger.getFilters()) {
						LOGGER.info("Filter element: " + filter);
					}
				}

				return acknowledger.getFilters();
			}
		}
		catch (Exception e) {
			LOGGER.warning("Unable to retrieve the filters from the agent. Cause: " + e.getMessage());
			e.printStackTrace();
			if (LOGGER.getLevel() == Level.FINEST) {
				LOGGER.log(Level.FINEST, "Exception: ", e);
			}
		}
		
		return null;
	}
1087841
protected BundleStreamSource invokeStreamFilters(BundleStreamSource stream) {
    assert (stream != null);
    if(filters == null) {
      return stream;
    }
    // We dynamically switch between streaming and bundle operations.
    MultipleObjectsBundle bundle = null;
    for(ObjectFilter filter : filters) {
      if(filter instanceof StreamFilter) {
        stream = ((StreamFilter) filter).init(bundle != null ? bundle.asStream() : stream);
        bundle = null;
      }
      else {
        bundle = filter.filter(stream != null ? stream.asMultipleObjectsBundle() : bundle);
        stream = null;
      }
    }
    return stream != null ? stream : bundle.asStream();
  }
1215355
public Collection<Epic> getChildEpics(EpicFilter filter) {
        filter = (filter != null) ? filter : new EpicFilter();
        filter.parent.clear();
        filter.parent.add(this);
        return getInstance().get().epics(filter);
    }
645282
@Override
    public boolean checkCondition(IValue test) throws FilterException {
        Iterator iter = values.iterator();
        while (iter.hasNext()) {
            IValue value = (IValue) iter.next();
            if (value.containedBy(test)) {
                return true;
            }
        }
        return false;
    }
1113583
public boolean select(Viewer viewer, Object parentElement, Object element) {
		
		if(hasFilter(FILTER_FIELDS) && isField(element) )
		{
			return false;
		}
		
		if(hasFilter(FILTER_NONPUBLIC) && isNonPublic(element)){
			return false;
		}
		
		if(hasFilter(FILTER_LOCALTYPES) && isLocalType(element)){
			return false;
		}
		
		if(hasFilter(FILTER_STATIC) && isStatic(element)){
			return false;
		}
		
//		try {
//			if (element instanceof IMember) {
//				
//
//				if (hasFilter(FILTER_FIELDS) && memberType == IJavaElement.FIELD) {
//					return false;
//				}
//
//				if (hasFilter(FILTER_LOCALTYPES) && memberType == IJavaElement.TYPE && isLocalType((IType) member)) {
//					return false;
//				}
//
//				if (member.getElementName().startsWith("<")) { // filter out <clinit> //$NON-NLS-1$
//					return false;
//				}
//				int flags= member.getFlags();
//				if (hasFilter(FILTER_STATIC) && (Flags.isStatic(flags) || isFieldInInterfaceOrAnnotation(member)) && memberType != IJavaElement.TYPE) {
//					return false;
//				}
//				if (hasFilter(FILTER_NONPUBLIC) && !Flags.isPublic(flags) && !isMemberInInterfaceOrAnnotation(member) && !isTopLevelType(member) && !isEnumConstant(member)) {
//					return false;
//				}
//			}
//		} catch (JavaModelException e) {
//			// ignore
//		}
		return true;
	}
649359
public static Set<Method> getDeclaredMethods(Class<?> clazz, MethodFilter methodFilter) {
        Method[] methods = clazz.getDeclaredMethods();
        Set<Method> matches = new HashSet<Method>();
        for (Method method : methods) {       
            if (methodFilter.passFilter(method)) {
                matches.add(method);
            }
        }
        return matches;
    }
524404
protected void compareNodeChildren(Node control, Node test,
                                       DifferenceListener listener, ElementQualifier elementQualifier) 
        throws DifferenceFoundException {

        List<Node> controlChildren = nodeList2List(control.getChildNodes());
        List<Node> testChildren = nodeList2List(test.getChildNodes());

        Integer controlLength = new Integer(controlChildren.size());
        Integer testLength = new Integer(testChildren.size());
        compare(controlLength, testLength, control, test, listener,
                CHILD_NODELIST_LENGTH);

        if (control.hasChildNodes() || test.hasChildNodes()) {
            if (!control.hasChildNodes()) {
                for (Node aTestChildren : testChildren) {
                    missingNode(null, aTestChildren, listener);
                }
            } else if (!test.hasChildNodes()) {
                for (Node aControlChildren : controlChildren) {
                    missingNode(aControlChildren, null, listener);
                }
             } else {
                compareNodeList(controlChildren, testChildren,
                                controlLength.intValue(), listener, elementQualifier);
            }
        }
    }
361085
public CmsRelationFilter filterInternal() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        if (filter.m_types.isEmpty()) {
            filter.m_types.addAll(CmsRelationType.getAllInternal());
        } else {
            filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterInternal(filter.m_types));
        }
        return filter;
    }