public static boolean hasFragmentId(String uri){
  return uri.indexOf('#') >= 0;
}

public static boolean hasFragmentId ( String uri ) { return uri . indexOf ( '#' ) >= 0 ; }
tests whether a valid uri reference has a fragment identifier . it is allowed to pass an invalid uri reference , but the result is not defined .
