@Nullable String findLongestNamePrefix(Node name,Set<String> namespaces){
  if (namespaces.contains(name.getQualifiedName())) {
    return name.getQualifiedName();
  }
 else   if (name.isGetProp()) {
    return findLongestNamePrefix(name.getFirstChild(),namespaces);
  }
  return null;
}

@ Nullable String findLongestNamePrefix ( Node name , Set < String > namespaces ) { if ( namespaces . contains ( name . getQualifiedName ( ) ) ) { return name . getQualifiedName ( ) ; } else if ( name . isGetProp ( ) ) { return findLongestNamePrefix ( name . getFirstChild ( ) , namespaces ) ; } return null ; }
gets the longest namespace that is a prefix of the name node . returns null if no namespaces are valid prefixes .
