public static void checkSameHost(Path p1,Path p2){
  Host p1Host=Host.fromUri(p1.toUri());
  Host p2Host=Host.fromUri(p2.toUri());
  checkArgument(p1Host.equals(p2Host),"first path host (%s) must equal second path host (%s)",p1Host,p2Host);
}

public static void checkSameHost ( Path p1 , Path p2 ) { Host p1Host = Host . fromUri ( p1 . toUri ( ) ) ; Host p2Host = Host . fromUri ( p2 . toUri ( ) ) ; checkArgument ( p1Host . equals ( p2Host ) , "first path host (%s) must equal second path host (%s)" , p1Host , p2Host ) ; }
ensures that two paths refer to the same host .
