@Override
    public AttributedList<Path> search(final Path workdir,
                                       final Filter<Path> regex,
                                       final ListProgressListener listener) throws BackgroundException {
        final AttributedList<Path> list = new AttributedList<>();

        // avoid searching the "special" folders if users search from the account root
        if(workdir.getParent().isRoot()) {
            final Predicate<MantaObject> fastSearchPredicate = o -> session.isWorldReadable(o) || session.isUserWritable(o);
            final List<Path> homeFolderPaths = findObjectsAsPaths(workdir, fastSearchPredicate);
            cleanResults(homeFolderPaths, regex);
            addPaths(list, workdir, listener, homeFolderPaths);

            /*
            // disable search of system directories until we can provide incremental results
            // slowSearchPredicate will prevent us from looking at ~~/public and ~~/stor twice
            final Predicate<MantaObject> slowSearchPredicate = fastSearchPredicate.negate();
            final List<Path> systemFolderObjects = findObjectsAsPaths(workdir, slowSearchPredicate.and(regexPredicate));
            cleanResults(systemFolderObjects, regex);
            addPaths(list, workdir, listener, systemFolderObjects);
            */
        }
        else {
            final List<Path> foundPaths = findObjectsAsPaths(workdir, null);
            cleanResults(foundPaths, regex);
            addPaths(list, workdir, listener, foundPaths);
        }

        return list;
    }
@Test
    public void testSearchSameDirectory() throws Exception {
        Assume.assumeTrue(session.getClient().existsAndIsAccessible(testPathPrefix.getAbsolute()));

        final String newDirectoryName = new AlphanumericRandomStringService().random();
        final Path newDirectory = new Path(testPathPrefix, newDirectoryName, TYPE_DIRECTORY);
        final String newFileName = new AlphanumericRandomStringService().random();
        new MantaDirectoryFeature(session).mkdir(newDirectory, null);
        new MantaTouchFeature(session).touch(new Path(newDirectory, newFileName, TYPE_FILE), null);

        final MantaSearchFeature s = new MantaSearchFeature(session);
        final AttributedList<Path> search = s.search(newDirectory, new NullFilter<>(), new DisabledListProgressListener());

        assertEquals(1, search.size());
        assertEquals(newFileName, search.get(0).getName());
    }