void () { final Pair<ConsentOptions, MemoryIOBackend> data = createConsentOptions(JSON_CONSENTS_DATA, JSON_CONSENTS_DATA); final ConsentOptions options = data.getFirst(); final MemoryIOBackend storage = data.getSecond(); final Pair<List<Consent>, Boolean> beforeConfirm = options.getConsents(); assertTrue("Consents should require confirmation", beforeConfirm.getSecond()); assertEquals(2, beforeConfirm.getFirst().size()); assertEquals(JSON_CONSENTS_DATA, storage.myDefaults); assertEquals("", storage.myConfirmed); assertNotNull(lookupConsent(CONSENT_ID_USAGE_STATS, beforeConfirm.getFirst())); assertEquals(ConsentOptions.Permission.UNDEFINED, options.isSendingUsageStatsAllowed()); options.setConsents(beforeConfirm.getFirst()); final Pair<List<Consent>, Boolean> afterConfirm = options.getConsents(); assertFalse("Consents should NOT require confirmation", afterConfirm.getSecond()); assertEquals(2, afterConfirm.getFirst().size()); assertEquals(JSON_CONSENTS_DATA, storage.myBundled); assertEquals(JSON_CONSENTS_DATA, storage.myDefaults); assertFalse("The storage should contain non-empty confirmed consents", StringUtil.isEmpty(storage.myConfirmed)); assertEquals(ConsentOptions.Permission.NO, options.isSendingUsageStatsAllowed()); }