https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/Optimizely.java#L135-L140 getExperimentOrThrow() will throw if the experiment is null, no need to check for null after that call because that will never happen.