InternalImportOptions extends ImportOptions implements InstallHookProcessorFactory { @Override public void setFilter(final WorkspaceFilter filter) { optionsDelegate.setFilter(filter); } InternalImportOptions(final @NotNull PackageId packageId, final @NotNull ClassLoader implClassLoader);   InternalImportOptions(final @NotNull PackageId packageId,
                          final @Nullable ImportOptions optionsDelegate,
                          final @Nullable Class<? extends InstallHookProcessor> internalInstallHookProcessorClazz); @Override InstallHookProcessor createInstallHookProcessor(); @Override ImportOptions copy(); InstallHookProcessorFactory getInstallHookProcessorFactoryDelegate(); void setInstallHookProcessorFactoryDelegate(final InstallHookProcessorFactory installHookProcessorFactoryDelegate); InstallHookPolicy getInstallHookPolicy(); void setInstallHookPolicy(final InstallHookPolicy installHookPolicy); ErrorListener getViolationReporter(); void setViolationReporter(final ErrorListener violationReporter); @Override boolean isStrict(); @Override void setStrict(final boolean strict); @Override ProgressTrackerListener getListener(); @Override void setListener(final ProgressTrackerListener listener); @Override String getPatchParentPath(); @Override void setPatchParentPath(final String patchParentPath); @Override File getPatchDirectory(); @Override void setPatchDirectory(final File patchDirectory); @Override boolean isPatchKeepInRepo(); @Override void setPatchKeepInRepo(final boolean patchKeepInRepo); @Override AccessControlHandling getAccessControlHandling(); @Override void setAccessControlHandling(final AccessControlHandling acHandling); @Override boolean isNonRecursive(); @Override void setNonRecursive(final boolean nonRecursive); @Override Pattern getCndPattern(); @Override void setCndPattern(final String cndPattern); @Override boolean isDryRun(); @Override void setDryRun(final boolean dryRun); @Override void setAutoSaveThreshold(final int threshold); @Override int getAutoSaveThreshold(); @Override ImportMode getImportMode(); @Override void setImportMode(final ImportMode importMode); @Override WorkspaceFilter getFilter(); @Override void setFilter(final WorkspaceFilter filter); @Override ClassLoader getHookClassLoader(); @Override void setHookClassLoader(final ClassLoader hookClassLoader); @Override PathMapping getPathMapping(); @Override void setPathMapping(final PathMapping pathMapping); @Override DependencyHandling getDependencyHandling(); @Override void setDependencyHandling(final DependencyHandling dependencyHandling);  }
@Test public void testSetFilter() { final ImportOptions delegate = new ImportOptions(); final InternalImportOptions options = new InternalImportOptions(pid, delegate, null); final WorkspaceFilter listener1 = mock(WorkspaceFilter.class); final WorkspaceFilter listener2 = mock(WorkspaceFilter.class); delegate.setFilter(listener1); assertSame("instance1", listener1, options.getFilter()); delegate.setFilter(listener2); assertSame("instance2", listener2, options.getFilter()); options.setFilter(listener1); assertSame("instance1", listener1, delegate.getFilter()); options.setFilter(listener2); assertSame("instance2", listener2, delegate.getFilter()); }