code: @SuppressWarnings("WeakerAccess")
    protected void clearRmiTargetsMap(ClassLoaderLeakPreventor preventor, Map<?, ?> rmiTargetsMap) {
      try {
        final Field cclField = preventor.findFieldOfClass("sun.rmi.transport.Target", "ccl");
        preventor.debug("Looping " + rmiTargetsMap.size() + " RMI Targets to find leaks");
        for(Iterator<?> iter = rmiTargetsMap.values().iterator(); iter.hasNext(); ) {
          Object target = iter.next(); // sun.rmi.transport.Target
          ClassLoader ccl = (ClassLoader) cclField.get(target);
          if(preventor.isClassLoaderOrChild(ccl)) {
            preventor.warn("Removing RMI Target: " + target);
            iter.remove();
          }
        }
      }
      catch (Exception ex) {
        preventor.error(ex);
      }
    }
docs: Iterate RMI Targets Map and remove entries loaded by protected ClassLoader