class TypeUtil {

	public static int computeDistance(Class<?> parent, Class<?> child) {
		int distance = -1;
		if (parent.equals(child)) {
			distance = 0;
		}

		// Search through super classes
		if (distance == -1) {
			distance = computeSuperDistance(parent, child);
		}

		// Search through interfaces (costly)
		if (distance == -1) {
			distance = computeInterfaceDistance(parent, child, new HashSet<String>(),
					Arrays.asList(child.getInterfaces()));
		}

		if (distance != -1) {
			distance *= DISTANCE_FACTOR;
		}

		return distance;
	}

}