private static <T> T convert(Object object, Class<T> type, Supplier<T> defaultValueSupplier) {
    return type.isInstance(object) ? type.cast(object) : defaultValueSupplier.get();
  }
Casts the object to the specified type, or returns the default value if the object cannot be
cast.
geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfigImpl.java