Returns a {@code Filter} that only runs the single method described by
{@code desiredDescription}
422234
public static Filter matchMethodDescription(final Description desiredDescription) {
        return new Filter() {
            @Override
            public boolean shouldRun(Description description) {
                if (description.isTest()) {
                    return desiredDescription.equals(description);
                }

                // explicitly check if any children want to run
                for (Description each : description.getChildren()) {
                    if (shouldRun(each)) {
                        return true;
                    }
                }
                return false;
            }

            @Override
            public String describe() {
                return String.format("Method %s", desiredDescription.getDisplayName());
            }
        };
    }
341567
public static Set<Method> getMethods(Class<?> target, MethodFilter methodFilter) {
        Class<?> clazz = target;
        Set<Method> matches = getDeclaredMethods(clazz, methodFilter);      
        while((clazz = clazz.getSuperclass()) != null) {     
            matches.addAll(getDeclaredMethods(clazz, methodFilter));
        }
        return matches;
    }
177125
public static List<Method> getPublicMethods(Class<?> clazz, Filter<Method> filter) {
		return ReflectUtil.getPublicMethods(clazz, filter);
	}
735459
public FilterHolder defineFilter(String name, String className)
    {
        FilterHolder holder= newFilterHolder(name,className);
        addFilterHolder(holder);
        return holder;
    }
44053
public String findFilter(String destination) {
        FindFilterEvent event = new FindFilterEvent();
        event.setDestination(destination);
        try {
            Object obj = delegate.callManager(event);
            if (obj != null && obj instanceof String) {
                return (String) obj;
            } else {
                throw new CanalException("No Such Canal by [" + destination + "]");
            }
        } catch (Exception e) {
            throw new CanalException("call_manager_error", e);
        }
    }
982135
public <ResultT> ResultT findOneAndDelete(final Bson filter,
                                     final Class<ResultT> resultClass) {
    return proxy.findOneAndDelete(filter, resultClass);
  }
618690
public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception
    {
        if (System.currentTimeMillis() % 2 == 1)
        {
            return chain.doFilter(obj, method, params);
        }
        else
        {
            throw new SecurityException("Wrong time. Try again later");
        }
    }
576249
private FilterDescriptor createFilter(FilterType filterType, Map<String, FilterDescriptor> filters, ScannerContext context) {
        Store store = context.getStore();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterType.getFilterName().getValue(), filters, store);
        setAsyncSupported(filterDescriptor, filterType.getAsyncSupported());
        for (DescriptionType descriptionType : filterType.getDescription()) {
            filterDescriptor.getDescriptions().add(XmlDescriptorHelper.createDescription(descriptionType, store));
        }
        for (DisplayNameType displayNameType : filterType.getDisplayName()) {
            filterDescriptor.getDisplayNames().add(XmlDescriptorHelper.createDisplayName(displayNameType, store));
        }
        FullyQualifiedClassType filterClass = filterType.getFilterClass();
        if (filterClass != null) {
            TypeResolver typeResolver = context.peek(TypeResolver.class);
            TypeCache.CachedType<TypeDescriptor> filterClassDescriptor = typeResolver.resolve(filterClass.getValue(), context);
            filterDescriptor.setType(filterClassDescriptor.getTypeDescriptor());
        }
        for (IconType iconType : filterType.getIcon()) {
            IconDescriptor iconDescriptor = XmlDescriptorHelper.createIcon(iconType, store);
            filterDescriptor.getIcons().add(iconDescriptor);
        }
        for (ParamValueType paramValueType : filterType.getInitParam()) {
            ParamValueDescriptor paramValueDescriptor = createParamValue(paramValueType, store);
            filterDescriptor.getInitParams().add(paramValueDescriptor);
        }
        return filterDescriptor;
    }
811113
public T filter(@NonNull SerializablePredicate<? super HString> filter) {
      this.filter = filter;
      return Cast.as(this);
   }
635735
private Filter getFilter(String layerFilter, String[] featureIds) throws GeomajasException {
		Filter filter = null;
		if (null != layerFilter) {
			filter = filterService.parseFilter(layerFilter);
		}
		if (null != featureIds) {
			Filter fidFilter = filterService.createFidFilter(featureIds);
			if (null == filter) {
				filter = fidFilter;
			} else {
				filter = filterService.createAndFilter(filter, fidFilter);
			}
		}
		return filter;
	}
627082
public static Method filter(List<Method> methods, Class<?> declareClass) {
        if (declareClass == null) {
            return null;
        }
        Optional<Method> optional = methods.stream()
            .filter(method -> method.getDeclaringClass() == declareClass).limit(1).findFirst();
        return optional.orElse(filter(methods, declareClass.getSuperclass()));
    }
686505
@Override
	public List<ScopDescription> filterByDescription(String query) throws ScopIOException {
		try {
			ensureDesInstalled();
		} catch (IOException e) {
			throw new ScopIOException(e);
		}

		query = query.toLowerCase();
		List<ScopDescription> matches = new ArrayList<ScopDescription>();
		for (Integer i : sunidMap.keySet()){
			ScopDescription sc = sunidMap.get(i);

			if( sc.getDescription().toLowerCase().startsWith(query)){
				matches.add(sc);
			}
		}

		return matches;
	}
559474
public static <T extends MethodDescription> ElementMatcher.Junction<T> isMethod() {
        return new MethodSortMatcher<T>(MethodSortMatcher.Sort.METHOD);
    }
551405
public Collection<Goal> goals(GoalFilter filter) {
        return get(Goal.class, (filter != null) ? filter : new GoalFilter());
    }
431885
public void setDescription(java.util.Collection<StringFilter> description) {
        if (description == null) {
            this.description = null;
            return;
        }

        this.description = new java.util.ArrayList<StringFilter>(description);
    }
1030499
def filterBy(self, **kwargs):
        ''' '''
        criteria = ['seeds', 'size']
        for k, v in kwargs.iteritems():
            if k in criteria:
                self.results = filter(
                    lambda x: getattr(x, k) >= v, self.results)
        return self
802911
@Override
    public void doFilter(ActionRequest request, ActionResponse response, FilterChain chain) throws IOException,
            PortletException {
        doCommonFilter(request, response, chain);
    }