code: protected static <AdapterType> AdapterType getAdapter(ResourceHandle resourceHandle, Class<AdapterType> type) {
          if (type == ResourceHandle.class) {
              return type.cast(resourceHandle);
          }
          log.info("Unable to adapt resource on {} to type {}", resourceHandle.getPath(), type.getName());
          return null;
      }
docs: Handles <code>resourceHandle.adaptTo(ResourceHandle.class)</code>.
  
  @param resourceHandle Object to adapt
  @param type target type
  @return original Object