Why bother…
ApplicationUser applicationUser = Optional.ofNullable(ComponentAccessor.getUserManager().getUserByName(userName)).orElse(null);ApplicationUser applicationUser = Optional.ofNullable(ComponentAccessor.getUserManager().getUserByName(userName)).orElse(null);