In the javadoc for Path::endsWith:
Note that trailing separators are not taken into account, and so invoking this method on the Path"foo/bar" with the String "bar/" returns true.
Notice the above is missing a space between "Path" and "foo/bar"
Note that trailing separators are not taken into account, and so invoking this method on the Path"foo/bar" with the String "bar/" returns true.
Notice the above is missing a space between "Path" and "foo/bar"