@Test(expected = IllegalArgumentException.class) public void testOpen_unsupported() throws Exception { slingSimulator.open(new UnsupportedSlingOpenable(PackageId.fromString("test"), "/test/installable")).tryGet(); }
@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()); }; }
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()); }; } }
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()); }; }  }
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()); }; }  static SlingSimulatorBackend instance(); @Override void startedScan(); @Override void setSession(final Session session); @Override void setPackageManager(final JcrPackageManager packageManager); @Override void setErrorListener(final ErrorListener errorListener); @Override @Nullable SlingInstallable dequeueInstallable(); @SuppressWarnings("unchecked") @Override @NotNull Fun.ThrowingSupplier<ResourceType> open(@NotNull final SlingOpenable<ResourceType> installable); @NotNull JcrPackage openEmbeddedPackage(@NotNull final EmbeddedPackageInstallable installable); @Override @Nullable SlingInstallable addInstallableNode(final @NotNull PackageId parentPackageId,
                                                         final @NotNull Node node); }
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()); }; }  static SlingSimulatorBackend instance(); @Override void startedScan(); @Override void setSession(final Session session); @Override void setPackageManager(final JcrPackageManager packageManager); @Override void setErrorListener(final ErrorListener errorListener); @Override @Nullable SlingInstallable dequeueInstallable(); @SuppressWarnings("unchecked") @Override @NotNull Fun.ThrowingSupplier<ResourceType> open(@NotNull final SlingOpenable<ResourceType> installable); @NotNull JcrPackage openEmbeddedPackage(@NotNull final EmbeddedPackageInstallable installable); @Override @Nullable SlingInstallable addInstallableNode(final @NotNull PackageId parentPackageId,
                                                         final @NotNull Node node);  }