code: private Project findProjectInDirectory(Resource<?> target, ProjectProvider projectProvider,
              Predicate<Project> filter)
     {
        Project result = null;
        Imported<ProjectCache> caches = getCaches();
        if (projectProvider.containsProject(target))
        {
           boolean cached = false;
           for (ProjectCache cache : caches)
           {
              result = cache.get(target);
              if (result != null && !filter.accept(result))
              {
                 result = null;
              }
              if (result != null)
              {
                 cached = true;
                 break;
              }
           }
           if (result == null)
           {
              result = projectProvider.createProject(target);
           }
           if (result != null && !filter.accept(result))
           {
              result = null;
           }
           if (result != null && !cached)
           {
              registerAvailableFacets(result);
              cacheProject(result);
           }
        }
  
        return result;
     }
docs: Returns project residing in given directory, if no such is found then null is returned.