public static List<Class<?>> getClassNamesFromJAR(File jar,
			ICondition<Class<?>> condition)
			throws IOException, ClassNotFoundException {
		List<Class<?>> out = new ArrayList<Class<?>>();

		// if the condition is null get a default condition
		if (condition == null) {
			condition = ConditionHelper.createDefault();
		}

		// load the jar
		JarFile file = new JarFile(jar);
		URLClassLoader loader =
				new URLClassLoader(new URL[] { jar.toURI().toURL() }, Thread
						.currentThread().getContextClassLoader());

		// loop through all jar file entries
		Enumeration<JarEntry> entries = file.entries();
		while (entries.hasMoreElements()) {
			JarEntry entry = entries.nextElement();

			// only process *.class files
			if (hasExtension(entry.toString(), ".class")) {
				String fullClassName = entry.toString().replace("/", ".");
				fullClassName = fullClassName.replace(".class", "");

				Class<?> clazz = loader.loadClass(fullClassName);
				if (condition.check(clazz)) {
					out.add(clazz);
					LOGGER.debug("Class " + fullClassName + " added.");
				}
			}
		}

		return out;
	}