static boolean areInSameRuntimeClassLoader(Class type1, Class type2) {

		if (type1.getPackage()!=type2.getPackage()) {
			return false;
		}
		ClassLoader loader1 = type1.getClassLoader();
		ClassLoader loader2 = type2.getClassLoader();
		ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
		if (loader1==null) {
			return (loader2==null || loader2==systemClassLoader);
		}
		if (loader2==null) {
			return loader1==systemClassLoader;
		}
		return loader1==loader2;
	}