The term you are looking for is a Canonical Path. In fact, it would be good to read up on the term Canonical, as that will provide useful context.
So, if you want to know if 2 instances of Path
are pointing to the same object, then find the Canonical Path to the file.
The way to find the Canonical Path to a file in Java is to use the method Path.toRealPath().
System.out.println(a.toRealPath().equals(b.toRealPath())); //true, as it should be!