public static List<String> filterByPrefix(
      List<String> nodes, String... prefixes
  ) {
    List<String> lockChildren = new ArrayList<String>();
    for (String child : nodes){
      for (String prefix : prefixes){
        if (child.startsWith(prefix)){
          lockChildren.add(child);
          break;
        }
      }
    }
    return lockChildren;
  }
public static List < String > filterByPrefix ( List < String > nodes , String ... prefixes ) { List < String > lockChildren = new ArrayList < String > ( ) ; for ( String child : nodes ) { for ( String prefix : prefixes ) { if ( child . startsWith ( prefix ) ) { lockChildren . add ( child ) ; break ; } } } return lockChildren ; }
Filters the given node list by the given prefixes.
This method is all-inclusive--if any element in the node list starts
with any of the given prefixes, then it is included in the result.

@param nodes the nodes to filter
@param prefixes the prefixes to include in the result
@return list of every element that starts with one of the prefixes