### Question:
CoalesceUnit { public Class<?> getOutputDataType() { Class<?> candidate = null; for (final InputColumn<?> inputColumn : _inputColumns) { final Class<?> dataType = inputColumn.getDataType(); if (candidate == null) { candidate = dataType; } else if (candidate == Object.class) { return candidate; } else { if (candidate != dataType) { if (ReflectionUtils.is(dataType, candidate)) { } else if (ReflectionUtils.is(candidate, dataType)) { candidate = dataType; } else { return Object.class; } } } } if (candidate == null) { return Object.class; } return candidate; } CoalesceUnit(final List<? extends InputColumn<?>> inputColumns);  CoalesceUnit(final String... columnNames);  CoalesceUnit(final InputColumn<?>... inputColumns); String[] getInputColumnNames(); CoalesceUnit getUpdatedCoalesceUnit(final InputColumn<?>[] newInputColumns); CoalesceUnit updateInputColumns(final InputColumn<?>[] allInputColumns); InputColumn<?>[] getUpdatedInputColumns(final InputColumn<?>[] allInputColumns,
            final boolean exceptionOnMissing); InputColumn<?>[] getInputColumns(); Class<?> getOutputDataType(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); String getSuggestedOutputColumnName();  }### Answer:
@Test public void testGetOutputDataType() throws Exception { final MockInputColumn<?> numberCol1 = new MockInputColumn<>("num1", Number.class); final MockInputColumn<?> numberCol2 = new MockInputColumn<>("num1", Number.class); final MockInputColumn<?> integerCol1 = new MockInputColumn<>("int1", Integer.class); final MockInputColumn<?> integerCol2 = new MockInputColumn<>("int2", Integer.class); final MockInputColumn<?> stringCol1 = new MockInputColumn<>("str1", String.class); final MockInputColumn<?> stringCol2 = new MockInputColumn<>("str2", String.class); final MockInputColumn<?> objCol1 = new MockInputColumn<>("obj1", Object.class); final InputColumn<?>[] allColumns = new InputColumn[] { numberCol1, numberCol2, integerCol1, integerCol2, stringCol1, stringCol2, objCol1 }; assertEquals(String.class, new CoalesceUnit(stringCol1, stringCol2).updateInputColumns(allColumns).getOutputDataType()); assertEquals(Number.class, new CoalesceUnit(numberCol1, numberCol2).updateInputColumns(allColumns).getOutputDataType()); assertEquals(Integer.class, new CoalesceUnit("int1", "int2").updateInputColumns(allColumns).getOutputDataType()); assertEquals(Number.class, new CoalesceUnit(numberCol1, integerCol2, integerCol1).updateInputColumns(allColumns) .getOutputDataType()); assertEquals(Number.class, new CoalesceUnit(integerCol2, integerCol1, numberCol1).updateInputColumns(allColumns) .getOutputDataType()); assertEquals(Object.class, new CoalesceUnit(stringCol1, stringCol1, integerCol1).updateInputColumns(allColumns) .getOutputDataType()); assertEquals(Object.class, new CoalesceUnit(stringCol1, stringCol1, objCol1).updateInputColumns(allColumns).getOutputDataType()); assertEquals(Object.class, new CoalesceUnit(objCol1).updateInputColumns(allColumns).getOutputDataType()); }