public void load(String libraryFileName, List<String> platforms) {
        if (loaded.contains(libraryFileName)) {
            return;
        }
        try {
            Throwable loadFailure = null;
            for (String platformId : platforms) {
                File libFile = nativeLibraryLocator.find(new LibraryDef(libraryFileName, platformId));
                if (libFile == null) {
                    continue;
                }

                try {
                    System.load(libFile.getCanonicalPath());
                } catch (UnsatisfiedLinkError e) {
                    loadFailure = e;
                    continue;
                }

                loaded.add(libraryFileName);
                return;
            }
            if (loadFailure != null) {
                throw loadFailure;
            }
            throw new NativeIntegrationUnavailableException(String.format("Native library '%s' is not available for %s.", libraryFileName, platform));
        } catch (NativeException e) {
            throw e;
        } catch (Throwable t) {
            throw new NativeException(String.format("Failed to load native library '%s' for %s.", libraryFileName, platform), t);
        }
    }