MavenWorkspaceReader implements WorkspaceReader { public List<String> findVersions(Artifact artifact) { MavenModule mavenModule = findModule(artifact); if (mavenModule != null) return Lists.newArrayList(mavenModule.getVersion()); else return Lists.newArrayList(); } MavenWorkspaceReader(WorkspaceFilesystem workspaceFilesystem, ModelProcessor modelProcessor, MavenWorkspaceListener listener);  MavenWorkspaceReader(WorkspaceFilesystem workspaceFilesystem, ModelProcessor modelProcessor); WorkspaceRepository getRepository(); File findArtifact(Artifact artifact); List<String> findVersions(Artifact artifact); MavenModule getRootModule(); List<MavenModule> getMavenModules();  }
@Test public void testFindVersionsPositive() throws MavenWorkspaceReaderException { MavenWorkspaceReader workspaceReader = new MavenWorkspaceReader(workspaceFilesystem, mavenBooter.modelProcessor()); assertThat(workspaceReader.findVersions(new DefaultArtifact("com.sonatype.example", "projB", "", "pom", "1.0.0-SNAPSHOT")), hasItem("1.0.0-SNAPSHOT")); }
@Test public void testFindVersionsNegative() throws MavenWorkspaceReaderException { MavenWorkspaceReader workspaceReader = new MavenWorkspaceReader(workspaceFilesystem, mavenBooter.modelProcessor()); assertThat(workspaceReader.findVersions(new DefaultArtifact("com.sonatype.example", "non-existing", "", "pom", "1.0.0-SNAPSHOT")).size(), is(0)); }