Utility that can be passed to Google Guava to find a particular result. E.g.
<pre>
Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, path))
</pre>

@param type operation type
@param forPath path
@return predicate
7793
public static Predicate<CuratorTransactionResult>       ofTypeAndPath(final OperationType type, final String forPath)
    {
        return new Predicate<CuratorTransactionResult>()
        {
            @Override
            public boolean apply(CuratorTransactionResult result)
            {
                return (result.getType() == type) && result.getForPath().equals(forPath);
            }
        };
    }
554146
public <T> JDOQuery<T> selectFrom(EntityPath<T> expr) {
        return select(expr).from(expr);
    }
138419
static Predicate<CtClass> createMatchingPredicate(final Set<PathMatcher> pathMatchers) {
        return ctClass -> {
            for (final PathMatcher pathMatcher : pathMatchers) {
                if (pathMatcher.matches(Paths.get(ctClass.getName()))) {
                    return true;
                }
            }
            return false;
        };
    }
1114641
@SuppressWarnings("unchecked")
    public static <T> T asType(Path path, Class<T> c) {
        if (c == Writable.class) {
            return (T) asWritable(path);
        }
        return DefaultGroovyMethods.asType((Object) path, c);
    }
214403
public TypeResults extractTypes(Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp, DBMetadata metadata)
            throws IncompatibleTermException {
        ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap = extractTermTypeMap(ruleIndex.values());

        return new TypeResults(termTypeMap,
                extractCastTypeMap(ruleIndex, predicatesInBottomUp, termTypeMap, metadata));
    }
985250
public <K, V, E extends SimpleExpression<V>> MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType) {
        validate(property, Map.class);
        return super.createMap(property, key, value, queryType);
    }
224454
public static <T extends Comparable<?>> ComparableEntityPath<T> comparableEntityPath(Class<? extends T> type,
                                                                             String variable) {
        return new ComparableEntityPath<T>(type, PathMetadataFactory.forVariable(variable));
    }
325663
@SuppressWarnings("unchecked")
    public <A> SimplePath<A> getSimple(String property, Class<A> type) {
        Class<? extends A> vtype = validate(property, type);
        return super.createSimple(property, (Class<? super A>) vtype);
    }
207952
public static <T> Path<T> path(Class<? extends T> type, String variable) {
        return new PathImpl<T>(type, variable);
    }
1121629
public <T> Map<String, T> findByTypeWithName(Class<T> type) {
        return applicationContext.getBeansOfType(type);
    }
1160370
def entity_type_path(cls, project, entity_type):
        """"""
        return google.api_core.path_template.expand(
            'projects/{project}/agent/entityTypes/{entity_type}',
            project=project,
            entity_type=entity_type,
        )
1181847
public static <T extends Comparable<?>> ComparableEntityPath<T> comparableEntityPath(Class<? extends T> type,
                                                                             Path<?> parent, String property) {
        return new ComparableEntityPath<T>(type, PathMetadataFactory.forProperty(parent, property));
    }
307756
public static <T> ActionPredicate<T> fromPredicate(final Predicate<T> predicate) {
	return new ActionPredicate<T>() {
	    public boolean actionPredicate(T obj) {
		return predicate.check(obj);
	    }
	};
    }
447916
@View(name = "by_type_and_local_date_time", map = "function(doc) { emit([doc.type, doc.creationTime], doc) }")
    public List<CouchDbCasEvent> findByTypeSince(final String type, final LocalDateTime localDateTime) {
        val view = createQuery("by_type_and_local_date_time").startKey(ComplexKey.of(type, localDateTime))
            .endKey(ComplexKey.of(type, LocalDateTime.now()));
        return db.queryView(view, CouchDbCasEvent.class);
    }
249809
@Override
	public JoinableResourceBundle resolveBundleForPath(String path) {

		JoinableResourceBundle theBundle = null;
		for (Iterator<JoinableResourceBundle> it = bundles.iterator(); it.hasNext();) {
			JoinableResourceBundle bundle = it.next();
			if (bundle.getId().equals(path) || bundle.belongsToBundle(path)) {
				theBundle = bundle;
				break;
			}
		}
		return theBundle;
	}
479942
protected void findMatching(Class<? extends T> type, BiPredicate<Class<? extends T>, D> predicate)
	{
		traverseType(type, predicate, new HashSet<>());
	}
229876
public static boolean isGrailsPath(String path) {
        if(KNOWN_PATHS.containsKey(path)) {
            return KNOWN_PATHS.get(path);
        }
        for (Pattern grailsAppResourcePattern : grailsAppResourcePatterns) {
            Matcher m = grailsAppResourcePattern.matcher(path);
            if (m.find()) {
                KNOWN_PATHS.put(path, true);
                return true;
            }
        }
        KNOWN_PATHS.put(path, false);
        return false;
    }