### Question:
ArtifactHandler { public String getArtifactLastVersion(final String gavc) { final List<String> versions = getArtifactVersions(gavc); final VersionsHandler versionHandler = new VersionsHandler(repositoryHandler); final String viaCompare = versionHandler.getLastVersion(versions); if (viaCompare != null) { return viaCompare; } LOG.info("The versions cannot be compared"); return Collections.max(versions); } ArtifactHandler(final RepositoryHandler repositoryHandler,
                           final LicenseMatcher matcher); void store(final DbArtifact dbArtifact); void storeIfNew(final DbArtifact fromClient); void addLicense(final String gavc, final String licenseId); List<String> getArtifactGavcs(final FiltersHolder filters); List<String> getArtifactGroupIds(final FiltersHolder filters); List<String> getArtifactVersions(final String gavc); String getArtifactLastVersion(final String gavc); DbArtifact getArtifact(final String gavc); DbArtifact getArtifactUsingSHA256(final String sha256); DbModule getModule(final DbArtifact dbArtifact); DbOrganization getOrganization(final DbArtifact dbArtifact); void updateDownLoadUrl(final String gavc, final String downLoadUrl); void updateProvider(final String gavc, final String provider); void deleteArtifact(final String gavc); void updateDoNotUse(final String gavc, final Boolean doNotUse); List<DbModule> getAncestors(final String gavc, final FiltersHolder filters); List<DbLicense> getArtifactLicenses(final String gavc, final FiltersHolder filters); void addLicenseToArtifact(final String gavc, final String licenseId); void removeLicenseFromArtifact(final String gavc, final String licenseId); List<DbArtifact> getArtifacts(final FiltersHolder filters); String getModuleJenkinsJobInfo(final DbArtifact dbArtifact);  }### Answer:
@Test public void getTheLastVersionOfAnArtifactThatDoesNotExist(){ final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class); final ArtifactHandler handler = new ArtifactHandler(repositoryHandler, mock(LicenseMatcher.class)); WebApplicationException exception = null; try{ handler.getArtifactLastVersion("doesNotExist"); }catch (WebApplicationException e){ exception = e; } assertNotNull(exception); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), exception.getResponse().getStatus()); }