@Test
public void testCopy() {

    final DefaultErrorListener errorListener = new DefaultErrorListener();
    final InstallHookPolicy policy = InstallHookPolicy.PROHIBIT;
    final InstallHookProcessorFactory factoryDelegate = TestInstallHookProcessor::new;
    InternalImportOptions options = new InternalImportOptions(pid, pcl);
    options.setViolationReporter(errorListener);
    options.setInstallHookPolicy(policy);
    options.setInstallHookProcessorFactoryDelegate(factoryDelegate);
    ImportOptions copy = options.copy();
    assertTrue("copy instance should be instance of same class",
            copy instanceof InternalImportOptions);
    InternalImportOptions typedCopy = (InternalImportOptions) copy;
    assertSame("same policy", InstallHookPolicy.PROHIBIT,
            typedCopy.getInstallHookPolicy());
    assertSame("same delegate", factoryDelegate,
            typedCopy.getInstallHookProcessorFactoryDelegate());
    assertSame("same reporter", errorListener,
            typedCopy.getViolationReporter());
}