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;
	}
@Test
	public void testDistance() {
		assertEquals(0, TypeUtil.computeDistance(ATest.class, ATest.class));
		assertEquals(100, TypeUtil.computeDistance(ATest.class, BTest.class));
		assertEquals(200, TypeUtil.computeDistance(ATest.class, CTest.class));
		assertEquals(300, TypeUtil.computeDistance(ATest.class, DTest.class));
		assertEquals(400, TypeUtil.computeDistance(Object.class, DTest.class));
		assertEquals(-1, TypeUtil.computeDistance(int.class, DTest.class));
		assertEquals(-1, TypeUtil.computeDistance(String.class, DTest.class));
		assertEquals(100, TypeUtil.computeDistance(I0Test.class, I1Test.class));
		assertEquals(100, TypeUtil.computeDistance(I0Test.class, VTest.class));
		assertEquals(200, TypeUtil.computeDistance(I0Test.class, WTest.class));
		assertEquals(100, TypeUtil.computeDistance(I1Test.class, WTest.class));
		assertEquals(100, TypeUtil.computeDistance(I0Test.class, XTest.class));
		assertEquals(200, TypeUtil.computeDistance(I0Test.class, YTest.class));
		assertEquals(300, TypeUtil.computeDistance(J0Test.class, YTest.class));
		assertEquals(400, TypeUtil.computeDistance(I0Test.class, ZTest.class));
	}