private static boolean canHandleRoutingImpl(FileSystemProvider provider) {
    Class<?> providerClass = provider.getClass();
    do {
      for (Class<?> iface : providerClass.getInterfaces()) {
        if (iface.getName().equals(RoutingAwareFileSystemProvider.class.getName())) {
          try {
            return (boolean)iface.getMethod("canHandleRouting").invoke(provider);
          }
          catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
            throw new RuntimeException(e);
          }
        }
      }
      providerClass = providerClass.getSuperclass();
    }
    while (providerClass != null);
    return false;
  }
private static boolean canHandleRoutingImpl(FileSystemProvider provider)