After upgrade from 4.1 to 5.2.1 I found that one of our test failed. Appeared the guilty was FSDirectory that converts given Path to Path.getRealPath. As result the test will fail:
Path p = Paths.get("/var/lucene_store");
FSDirectory d = new FSDirectory(p);
It because /var/lucene_store is a symlink and
Path directory =path.getRealPath();
resolves it to /private/var/lucene_store
I think this is bad design decision because "direcrory" isn't just internal state but is exposed in a public interface and "getDirectory()" is widely used to initialize other components.
It should use paths.getAbsolutePath() instead.
build and "ant test" were successful after fix.