### Question:
TypeUtil { static public DataType getResultDataType(DataType left, DataType right){ if((left).equals(right)){ return left; } for(int i = 0; i < inheritanceSequence.length; i++){ DataType dataType = inheritanceSequence[i]; if((dataType).equals(left) || (dataType).equals(right)){ return dataType; } } throw new EvaluationException(); } private  TypeUtil(); static boolean equals(DataType dataType, Object left, Object right); @SuppressWarnings ( value = {"rawtypes", "unchecked"} ) static int compare(DataType dataType, Object left, Object right); static Object parseOrCast(DataType dataType, Object value); static Object parse(DataType dataType, String value); static String format(Object value); static DataType getDataType(Object value); static DataType getResultDataType(DataType left, DataType right); static OpType getOpType(DataType dataType); static Object cast(DataType dataType, Object value); static DataType getConstantDataType(String string);  }### Answer:
@Test public void getResultDataType(){ assertEquals(DataType.DOUBLE, getResultDataType(1d, 1f)); assertEquals(DataType.DOUBLE, getResultDataType(1d, 1)); assertEquals(DataType.DOUBLE, getResultDataType(1f, 1d)); assertEquals(DataType.FLOAT, getResultDataType(1f, 1)); assertEquals(DataType.DOUBLE, getResultDataType(1, 1d)); assertEquals(DataType.FLOAT, getResultDataType(1, 1f)); }