I agree, how about making it return an Optional<String> and use have the check in the caller of this method ?