private boolean tokenStartsWithPrefix(String token,String... prefixes){
  String[] tokenParts=token.split(":",2);
  if (tokenParts.length == 2) {
    for (    String prefix : prefixes) {
      if (prefix.equals(tokenParts[0])) {
        return true;
      }
    }
  }
  return false;
}

private boolean tokenStartsWithPrefix ( String token , String ... prefixes ) { String [ ] tokenParts = token . split ( ":" , 2 ) ; if ( tokenParts . length == 2 ) { for ( String prefix : prefixes ) { if ( prefix . equals ( tokenParts [ 0 ] ) ) { return true ; } } } return false ; }
returns whether the token starts with one of the prefixes passed .
