This commit replaces optional.isEmpty() and optional.get() with optional.orElse(null) for better efficiency and readability. Closes gh-33612
This commit replaces optional.isEmpty() and optional.get() with optional.orElse(null) for better efficiency and readability. Closes gh-33612