### Question:
MavenDependencyResolver implements DependencyResolver { @Override public DependencyMetadata resolveDependencyMetadata(final DependencyQuery query) { try { if (Strings.isNullOrEmpty(query.getCoordinate().getVersion())) { throw new IllegalArgumentException("Dependency query coordinate version must be specified."); } RepositorySystem system = container.getRepositorySystem(); Settings settings = container.getSettings(); DefaultRepositorySystemSession session = container.setupRepoSession(system, settings); Artifact artifact = MavenConvertUtils.coordinateToMavenArtifact(query.getCoordinate()); List<RemoteRepository> remoteRepos = MavenConvertUtils.convertToMavenRepos(query.getDependencyRepositories(), settings); remoteRepos.addAll(MavenRepositories.getRemoteRepositories(container, settings)); ArtifactDescriptorRequest ar = new ArtifactDescriptorRequest(artifact, remoteRepos, null); ArtifactDescriptorResult results = system.readArtifactDescriptor(session, ar); Artifact a = results.getArtifact(); Dependency d = DependencyBuilder.create().setArtifactId(a.getArtifactId()).setGroupId(a.getGroupId()) .setVersion(a.getBaseVersion()); return new DependencyMetadataImpl(d, results); } catch (Exception e) { throw new DependencyException("Unable to resolve any artifacts for query [" + query + "]", e); } } 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 testResolveMetadata() throws Exception { DependencyQuery query = DependencyQueryBuilder .create("org.jboss.forge:resources:jar:forge-addon:2.0.0.Alpha3"); DependencyMetadata metadata = resolver.resolveDependencyMetadata(query); Assert.assertNotNull(metadata); Assert.assertTrue(metadata.getDependencies().contains( DependencyBuilder.create("junit:junit:4.11"))); }