class DefaultSlingSimulator implements SlingSimulatorBackend, SlingSimulator {

    @SuppressWarnings("unchecked")
    @Override
    public @NotNull <ResourceType> Fun.ThrowingSupplier<ResourceType>
    open(@NotNull final SlingOpenable<ResourceType> installable) {
        if (installable instanceof EmbeddedPackageInstallable) {
            return () ->
                    (ResourceType) openEmbeddedPackage((EmbeddedPackageInstallable) installable);
        }
        return () -> {
            throw new IllegalArgumentException("Unsupported installable type: " + installable.getClass());
        };
    }

}