Removing AutoCloseable from CoreSession and having a separate CloseableCoreSession interface helps clean up the code and make it more explicit.
It also avoids having to add @SuppressWarnings("resource") in front of every call to doc.getCoreSession() because CoreSession doesn't implement Closeable anymore.