private static int getDist(Class<?> superClass, Class<?> klass) {
		if (klass.isArray()) {
			if (superClass.isArray()) {
				superClass = superClass.getComponentType();
				klass = klass.getComponentType();
			} else {
				// superClass must be Object. An array fitting into an Object
				// must be more general than an array fitting into an Object[]
				// array.
				return 3000;
			}
		}
		
		if (superClass.equals(klass)) return 0;
		if (superClass.equals(Object.class)) return 2000; // specifying Object is always the most general
		if (superClass.isInterface()) {
			return 1000;
		}
		
		int dist = 0;
		while (true) {
			dist++;
			klass = klass.getSuperclass();
			if (superClass.equals(klass)) return dist;
		}
	}