public void check(Metadata metadata) throws AccessPermissionException {
        if (!needToCheck) {
            return;
        }
        if ("false".equals(metadata.get(AccessPermissions.EXTRACT_CONTENT))) {
            if (allowExtractionForAccessibility) {
                if ("true".equals(metadata.get(AccessPermissions.EXTRACT_FOR_ACCESSIBILITY))) {
                    return;
                }
                throw new AccessPermissionException(
                        "Content extraction for accessibility is not allowed.");
            }
            throw new AccessPermissionException("Content extraction is not allowed.");
        }
    }
@Test
    public void testIllogicalExtractNotForAccessibility() throws AccessPermissionException {
        Metadata m = getMetadata(true, false);
        //allow accessibility
        AccessChecker checker = new AccessChecker(true);
        checker.check(m);
        assertTrue(true, "no exception");

        //don't extract for accessibility
        checker = new AccessChecker(false);
        //if extract content is allowed, the checker shouldn't
        //check the value of extract for accessibility
        checker.check(m);
        assertTrue(true, "no exception");

    }