ContractUtils { public static String getContractManifestFilename(ContractManifest manifest) { Object extra = manifest.getExtra(); if (extra instanceof HashMap) { HashMap<String, String> eHashMap = (HashMap<String, String>) extra; if (eHashMap.containsKey("name")) { return eHashMap.get("name") + "." + MANIFEST_FILENAME_SUFFIX; } } return MANIFEST_FILENAME_SUFFIX; }  static String generateContractManifestFile(
            ContractManifest manifest, File destinationDirectory); static String generateContractManifestFile(
            ContractManifest manifest, String fileName, File destinationDirectory); static ContractManifest loadContractManifestFile(String absoluteFilePath); static String getContractManifestFilename(ContractManifest manifest);  }
@Test public void testGetContractManifestFilenameHappyPath() { HashMap<String, String> extras = new HashMap<>(); extras.put("name", "blah"); ContractManifest m = new ContractManifest(null, null, null, null, null, null, null, extras); String result = getContractManifestFilename(m); assertThat(result, is("blah" + "." + ContractUtils.MANIFEST_FILENAME_SUFFIX)); }
@Test public void testGetContractManifestFilenameNoManifestName() { HashMap<String, String> extras = new HashMap<>(); ContractManifest m = new ContractManifest(null, null, null, null, null, null, null, extras); String result = getContractManifestFilename(m); assertThat(result, is(ContractUtils.MANIFEST_FILENAME_SUFFIX)); }