public void addEntry(WhitelistEntry entry) {
        final UrlWhitelist modified = addEntry(getWhitelist(), entry);
        saveWhitelist(modified);
    }
@Test
    public void addEntry() {
        final WhitelistEntry existingEntry = LiteralWhitelistEntry.create("a", "a", "a");
        final UrlWhitelist existingWhitelist = UrlWhitelist.createEnabled(Collections.singletonList(existingEntry));
        final WhitelistEntry newEntry = LiteralWhitelistEntry.create("b", "b", "b");

        final UrlWhitelist whitelistWithEntryAdded = urlWhitelistService.addEntry(existingWhitelist, newEntry);
        assertThat(whitelistWithEntryAdded).isEqualTo(
                UrlWhitelist.createEnabled(ImmutableList.of(existingEntry, newEntry)));

        final WhitelistEntry replacedEntry = LiteralWhitelistEntry.create("a", "c", "c");

        final UrlWhitelist whitelistWithEntryReplaced =
                urlWhitelistService.addEntry(whitelistWithEntryAdded, replacedEntry);
        assertThat(whitelistWithEntryReplaced).isEqualTo(
                UrlWhitelist.createEnabled(ImmutableList.of(replacedEntry, newEntry)));

    }