DefaultLicenseStore implements LicenseStore<DefaultLicenseDef>, LicenseSource { @Override public boolean containsLicense(String licenseId) { FileObject licenseRoot = tryGetLicenseRoot(); if (licenseRoot == null) { return false; } String fileName = toLicenseFileName(licenseId); return licenseRoot.getFileObject(fileName) != null; }  @Override void addLicense(DefaultLicenseDef licenseDef); @Override Collection<LicenseRef> getAllLicense(); @Override void removeLicense(String licenseId); @Override boolean containsLicense(String licenseId);  }
@Test public void testAddAndRemove() throws IOException { Path src = TMP_FILE.getFile(); final DefaultLicenseDef licenseDef = new DefaultLicenseDef(src, "TestLicense1", "TestDisplayName1"); final DefaultLicenseStore store = new DefaultLicenseStore(); addAndRemove(store, licenseDef, () -> { assertTrue(store.containsLicense(licenseDef.getLicenseId())); }); assertFalse(store.containsLicense(licenseDef.getLicenseId())); }