// Path: src/main/java/org/simplify4u/plugins/ArtifactResolver.java
// public static final class Configuration {
// 
//     final SkipFilter dependencyFilter;
//     final SkipFilter pluginFilter;
//     final boolean verifyPomFiles;
//     final boolean verifyPlugins;
//     final boolean verifyPluginDependencies;
//     final boolean verifyAtypical;
// 
//     /**
//      * Constructor.
//      *
//      * @param dependencyFilter         filter for evaluating dependencies
//      * @param pluginFilter             filter for evaluating plugins
//      * @param verifyPomFiles           verify POM files as well
//      * @param verifyPlugins            verify build plugins as well
//      * @param verifyPluginDependencies verify all dependencies of build plug-ins.
//      * @param verifyAtypical           verify dependencies in a-typical locations, such as maven-compiler-plugin's
//      */
//     public Configuration(SkipFilter dependencyFilter, SkipFilter pluginFilter, boolean verifyPomFiles,
//             boolean verifyPlugins, boolean verifyPluginDependencies, boolean verifyAtypical) {
//         this.dependencyFilter = requireNonNull(dependencyFilter);
//         this.pluginFilter = requireNonNull(pluginFilter);
//         this.verifyPomFiles = verifyPomFiles;
//         this.verifyPlugins = verifyPlugins || verifyPluginDependencies;
//         this.verifyPluginDependencies = verifyPluginDependencies;
//         this.verifyAtypical = verifyAtypical;
//     }
// }
// 
// Path: src/main/java/org/simplify4u/plugins/skipfilters/CompositeSkipper.java
// public final class CompositeSkipper implements SkipFilter {
// 
//     private final Iterable<SkipFilter> filters;
// 
//     /**
//      * Constructor to compose any number of {@link SkipFilter}s.
//      *
//      * @param filters the filters
//      */
//     public CompositeSkipper(Iterable<SkipFilter> filters) {
//         this.filters = requireNonNull(filters);
//     }
// 
//     /**
//      * Constructor to compose any number of {@link SkipFilter}s.
//      *
//      * @param filters the filters
//      */
//     public CompositeSkipper(SkipFilter... filters) {
//         if (stream(filters).anyMatch(Objects::isNull)) {
//             throw new IllegalArgumentException("filters cannot contain null");
//         }
//         this.filters = asList(filters);
//     }
// 
//     @Override
//     public boolean shouldSkipArtifact(Artifact artifact) {
//         requireNonNull(artifact);
//         for (final SkipFilter filter : this.filters) {
//             if (filter.shouldSkipArtifact(artifact)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// }


import java.util.Map;
import java.util.Set;
import static java.util.Collections.emptyList;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.internal.verification.VerificationModeFactory.times;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.repository.RepositorySystem;
import org.assertj.core.api.Condition;
import org.mockito.Mock;
import org.mockito.stubbing.Answer;
import org.mockito.testng.MockitoTestNGListener;
import org.simplify4u.plugins.ArtifactResolver.Configuration;
import org.simplify4u.plugins.skipfilters.CompositeSkipper;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

    private ArtifactResolver resolver;

    @BeforeMethod
    void setup() {
        when(session.getLocalRepository()).thenReturn(localRepository);
        when(session.getCurrentProject()).thenReturn(project);
        when(project.getRemoteArtifactRepositories()).thenReturn(emptyList());

        resolver = new ArtifactResolver(repositorySystem, session);
    }

    @Test
    public void testConstructArtifactResolverWithNull() {

        reset(session, project);

        assertThatCode(() -> new ArtifactResolver(null, null))
                .isExactlyInstanceOf(NullPointerException.class);

        assertThatCode(() -> new ArtifactResolver(null, session))
                .isExactlyInstanceOf(NullPointerException.class);

        doThrow(new NullPointerException()).when(session).getLocalRepository();
        assertThatCode(() -> new ArtifactResolver(repositorySystem, session))
                .isExactlyInstanceOf(NullPointerException.class);

        doReturn(localRepository).when(session).getLocalRepository();
        doThrow(new NullPointerException()).when(session).getCurrentProject();
        assertThatCode(() -> new ArtifactResolver(repositorySystem, session))
// Path: src/main/java/org/simplify4u/plugins/ArtifactResolver.java
// public static final class Configuration {
// 
//     final SkipFilter dependencyFilter;
//     final SkipFilter pluginFilter;
//     final boolean verifyPomFiles;
//     final boolean verifyPlugins;
//     final boolean verifyPluginDependencies;
//     final boolean verifyAtypical;
// 
//     /**
//      * Constructor.
//      *
//      * @param dependencyFilter         filter for evaluating dependencies
//      * @param pluginFilter             filter for evaluating plugins
//      * @param verifyPomFiles           verify POM files as well
//      * @param verifyPlugins            verify build plugins as well
//      * @param verifyPluginDependencies verify all dependencies of build plug-ins.
//      * @param verifyAtypical           verify dependencies in a-typical locations, such as maven-compiler-plugin's
//      */
//     public Configuration(SkipFilter dependencyFilter, SkipFilter pluginFilter, boolean verifyPomFiles,
//             boolean verifyPlugins, boolean verifyPluginDependencies, boolean verifyAtypical) {
//         this.dependencyFilter = requireNonNull(dependencyFilter);
//         this.pluginFilter = requireNonNull(pluginFilter);
//         this.verifyPomFiles = verifyPomFiles;
//         this.verifyPlugins = verifyPlugins || verifyPluginDependencies;
//         this.verifyPluginDependencies = verifyPluginDependencies;
//         this.verifyAtypical = verifyAtypical;
//     }
// }
// 
// Path: src/main/java/org/simplify4u/plugins/skipfilters/CompositeSkipper.java
// public final class CompositeSkipper implements SkipFilter {
// 
//     private final Iterable<SkipFilter> filters;
// 
//     /**
//      * Constructor to compose any number of {@link SkipFilter}s.
//      *
//      * @param filters the filters
//      */
//     public CompositeSkipper(Iterable<SkipFilter> filters) {
//         this.filters = requireNonNull(filters);
//     }
// 
//     /**
//      * Constructor to compose any number of {@link SkipFilter}s.
//      *
//      * @param filters the filters
//      */
//     public CompositeSkipper(SkipFilter... filters) {
//         if (stream(filters).anyMatch(Objects::isNull)) {
//             throw new IllegalArgumentException("filters cannot contain null");
//         }
//         this.filters = asList(filters);
//     }
// 
//     @Override
//     public boolean shouldSkipArtifact(Artifact artifact) {
//         requireNonNull(artifact);
//         for (final SkipFilter filter : this.filters) {
//             if (filter.shouldSkipArtifact(artifact)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// }


// Path: src/test/java/org/simplify4u/plugins/ArtifactResolverTest.java
import java.util.Map;
import java.util.Set;
import static java.util.Collections.emptyList;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.internal.verification.VerificationModeFactory.times;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.repository.RepositorySystem;
import org.assertj.core.api.Condition;
import org.mockito.Mock;
import org.mockito.stubbing.Answer;
import org.mockito.testng.MockitoTestNGListener;
import org.simplify4u.plugins.ArtifactResolver.Configuration;
import org.simplify4u.plugins.skipfilters.CompositeSkipper;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;


    private ArtifactResolver resolver;

    @BeforeMethod
    void setup() {
        when(session.getLocalRepository()).thenReturn(localRepository);
        when(session.getCurrentProject()).thenReturn(project);
        when(project.getRemoteArtifactRepositories()).thenReturn(emptyList());

        resolver = new ArtifactResolver(repositorySystem, session);
    }

    @Test
    public void testConstructArtifactResolverWithNull() {

        reset(session, project);

        assertThatCode(() -> new ArtifactResolver(null, null))
                .isExactlyInstanceOf(NullPointerException.class);

        assertThatCode(() -> new ArtifactResolver(null, session))
                .isExactlyInstanceOf(NullPointerException.class);

        doThrow(new NullPointerException()).when(session).getLocalRepository();
        assertThatCode(() -> new ArtifactResolver(repositorySystem, session))
                .isExactlyInstanceOf(NullPointerException.class);

        doReturn(localRepository).when(session).getLocalRepository();
        doThrow(new NullPointerException()).when(session).getCurrentProject();
        assertThatCode(() -> new ArtifactResolver(repositorySystem, session))
                .isExactlyInstanceOf(NullPointerException.class);