@Override
    public void checkPermission ( Permission perm ) {

        if ( perm instanceof RuntimePermission ) {
            return;
        }

        Set<URL> cbs = new HashSet<>();
        for ( Class<?> cl : getClassContext() ) {
            if ( cl.getProtectionDomain() != null && cl.getProtectionDomain().getCodeSource() != null
                    && cl.getProtectionDomain().getCodeSource().getLocation() != null
                    && !"file".equals(cl.getProtectionDomain().getCodeSource().getLocation().getProtocol()) ) {
                cbs.add(cl.getProtectionDomain().getCodeSource().getLocation());
            }
        }

        this.remoteCodebases.addAll(cbs);
    }
{@inheritDoc}

@see java.lang.SecurityManager#checkPermission(java.security.Permission)
src/main/java/marshalsec/TestingSecurityManager.java