private static void checkJar(URL resource, String pkgname,
            List<Class<?>> classes) {
        String jarPath = resource.getPath()
                .replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");

        try (JarFile jarFile = new JarFile(jarPath)) {
            String relPath = pkgname.replace('.', '/');

            jarFile.stream().forEach((entry) -> {
                String entryName = entry.getName();
                if (entryName.endsWith(".class") && entryName.startsWith(
                        relPath) && entryName.length() > relPath.length() + "/"
                        .length()) {
                    classes.add(loadClass(entryName.replace('/', '.')
                            .replace('\\', '.').replace(".class", "")));
                }
            });
        } catch (IOException e) {
            throw new ReflectException(e);
        }
    }