### Question:
TypeCompare { public TypeCompareEnum compareTypes(ArgType first, ArgType second) { if (first == second || Objects.equals(first, second)) { return TypeCompareEnum.EQUAL; } boolean firstKnown = first.isTypeKnown(); boolean secondKnown = second.isTypeKnown(); if (firstKnown != secondKnown) { if (firstKnown) { return compareWithUnknown(first, second); } else { return compareWithUnknown(second, first).invert(); } } boolean firstArray = first.isArray(); boolean secondArray = second.isArray(); if (firstArray != secondArray) { if (firstArray) { return compareArrayWithOtherType(first, second); } else { return compareArrayWithOtherType(second, first).invert(); } } if (firstArray ) { return compareTypes(first.getArrayElement(), second.getArrayElement()); } if (!firstKnown ) { int variantLen = Integer.compare(first.getPossibleTypes().length, second.getPossibleTypes().length); return variantLen > 0 ? WIDER : NARROW; } boolean firstPrimitive = first.isPrimitive(); boolean secondPrimitive = second.isPrimitive(); boolean firstObj = first.isObject(); boolean secondObj = second.isObject(); if (firstObj && secondObj) { return compareObjects(first, second); } else { if (firstObj && secondPrimitive) { return CONFLICT; } if (firstPrimitive && secondObj) { return CONFLICT; } } if (firstPrimitive && secondPrimitive) { int comparePrimitives = first.getPrimitiveType().compareTo(second.getPrimitiveType()); return comparePrimitives > 0 ? WIDER : NARROW; } LOG.warn("Type compare function not complete, can't compare {} and {}", first, second); return TypeCompareEnum.CONFLICT; } TypeCompare(RootNode root); TypeCompareEnum compareTypes(ArgType first, ArgType second); Comparator<ArgType> getComparator(); Comparator<ArgType> getReversedComparator();  }### Answer:
@Test public void compareTypes() { firstIsNarrow(INT, UNKNOWN); firstIsNarrow(BOOLEAN, INT); firstIsNarrow(array(UNKNOWN), UNKNOWN); firstIsNarrow(array(UNKNOWN), NARROW); }