### Question:
ArtifactDetails { static List<URLChecksumEntity> getArtifactDetailsForCurrentPlatformByRole(File downloadFile, InstanceType instanceType) throws FileNotFoundException { Preconditions.checkNotNull(downloadFile, "The JSON to get artifact details cannot be null"); List<URLChecksumEntity> artifactDetails = new ArrayList<URLChecksumEntity>(); JsonArray downloads = (new JsonParser()).parse(new FileReader(downloadFile)).getAsJsonArray(); for (int i = 0; i < downloads.size(); i++) { JsonObject artifact = (JsonObject) downloads.get(i); if (artifact.has(NAME)) { JsonElement platformJson = artifact.has("any") ? artifact.get("any") : artifact.get(getPlatform()); JsonArray rolesJson = artifact.has(ROLES) ? artifact.get(ROLES).getAsJsonArray() : new JsonArray(); if (platformJson != null) { JsonObject platform = platformJson.getAsJsonObject(); if (rolesJson.contains(new JsonParser().parse(instanceType.getFriendlyName()))) { String url = platform.get(URL).getAsString(); String checksum = platform.get(CHECKSUM).getAsString(); URLChecksumEntity entity = getEntityFromProp(URL, url, CHECKSUM, checksum); artifactDetails.add(entity); } } } } return artifactDetails; }    }### Answer:
@Test public void testGetArtifactDetailsByRole() throws FileNotFoundException { File fileToTest = new File("src/test/resources/config/Dummydownload.json"); List<URLChecksumEntity> parsedDetails = ArtifactDetails.getArtifactDetailsForCurrentPlatformByRole(fileToTest, InstanceType.SELENIUM_NODE); assertEquals(parsedDetails.size(), 2); URLChecksumEntity entity = parsedDetails.get(0); assertEquals(entity.getUrl().getValue(), "seleniumURL"); assertEquals(entity.getChecksum().getValue(), "seleniumChecksum"); entity = parsedDetails.get(1); assertNotNull(entity.getUrl().getValue()); assertNotNull(entity.getChecksum().getValue()); }