private static <T> T getObjectOfTypeFromFactoryMethod(String factoryMethodName) {
    T actualObject;
    try {
      Method factoryMethod = methodFromName(factoryMethodName);
      actualObject = (T) factoryMethod.invoke(null, (Object[]) null);
    } catch (Exception e) {
      throw new GemFireSecurityException("Instance could not be obtained from " + factoryMethodName,
          e);
    }

    if (actualObject == null) {
      throw new GemFireSecurityException(
          "Instance could not be obtained from " + factoryMethodName);
    }

    return actualObject;
  }
this method would never return null, it either throws an exception or returns an object
geode-core/src/main/java/org/apache/geode/internal/security/CallbackInstantiator.java