### Question:
MavenDependencyResolver implements DependencyResolver { @Override public Set<Dependency> resolveDependencies(DependencyQuery query) { Set<Dependency> result = new HashSet<>(); Predicate<Dependency> filter = query.getDependencyFilter(); RepositorySystem system = container.getRepositorySystem(); Settings settings = container.getSettings(); DefaultRepositorySystemSession session = container.setupRepoSession(system, settings); Artifact queryArtifact = MavenConvertUtils.coordinateToMavenArtifact(query.getCoordinate()); List<RemoteRepository> remoteRepos = MavenConvertUtils.convertToMavenRepos(query.getDependencyRepositories(), settings); remoteRepos.addAll(MavenRepositories.getRemoteRepositories(container, settings)); CollectRequest collectRequest = new CollectRequest(new org.eclipse.aether.graph.Dependency(queryArtifact, query.getScopeType()), remoteRepos); DependencyRequest request = new DependencyRequest(collectRequest, null); DependencyResult artifacts; try { artifacts = system.resolveDependencies(session, request); } catch (NullPointerException e) { throw new RuntimeException("Could not resolve dependencies from Query [" + query + "] due to underlying exception", e); } catch (DependencyResolutionException e) { throw new RuntimeException(e); } DependencyNode root = artifacts.getRoot(); ResourceFactory factory = getResourceFactory(); for (DependencyNode node : root.getChildren()) { Dependency d = MavenConvertUtils.convertToDependency(factory, node); if (filter == null || filter.accept(d)) { result.add(d); } } return result; } MavenDependencyResolver();  MavenDependencyResolver(ResourceFactory resourceFactory); @Override Set<Dependency> resolveDependencies(DependencyQuery query); @Override List<Coordinate> resolveVersions(DependencyQuery query); @Override Dependency resolveArtifact(DependencyQuery query); @Override org.jboss.forge.addon.dependencies.DependencyNode resolveDependencyHierarchy(final DependencyQuery query); @Override DependencyMetadata resolveDependencyMetadata(final DependencyQuery query);  }### Answer:
@Test public void testResolveClassifiedArtifact() throws Exception { CoordinateBuilder coordinate = CoordinateBuilder.create("org.jboss.forge:resources:2.0.0.Alpha3") .setClassifier("forge-addon"); DependencyQueryBuilder query = DependencyQueryBuilder.create(coordinate).setFilter(addonFilter); Set<Dependency> artifacts = resolver.resolveDependencies(query); Assert.assertFalse(artifacts.isEmpty()); Assert.assertEquals(3, artifacts.size()); Dependency dependency = artifacts.iterator().next(); Assert.assertEquals("forge-addon", dependency.getCoordinate().getClassifier()); Assert.assertNotNull(dependency.getScopeType()); }
@Test(expected = RuntimeException.class) public void testResolveWildcardArtifactId() throws Exception { DependencyQuery query = DependencyQueryBuilder.create(CoordinateBuilder.create().setGroupId("org.jboss.forge") .setArtifactId("").setClassifier("forge-addon")); Set<Dependency> coreAddons = resolver.resolveDependencies(query); Assert.assertFalse(coreAddons.isEmpty()); }