protected static List<String> expand(final List<String> paths, final String fname) {
    final List<String> expanded = new ArrayList<String>();
    for (final String inc : paths) {
      if (inc.startsWith(PathFilter.WILDCARD_DEEP)) {
        expanded.add(inc);
      }
      final int firstSeparator = inc.indexOf('/');
      if (firstSeparator > 0 && (firstSeparator < inc.length() - 1)) {
        final String firstPath = inc.substring(0, firstSeparator);
        final String remainingPath = inc.substring(firstSeparator + 1);
        if (PathFilter.matchesWildcards(firstPath) || fname.equals(firstPath)) {
          expanded.add(remainingPath);
        }
      }
    }
    return expanded;
  }