@Test public void createCoalesceExpression_ObjectAndStringOperands_ReturnClassIsString() { Class<?> expectedClass = Object.class; Object left = new Object(); Object right = "1"; Expression e = coalesce(left, right); assertThat(e.getResultClass(), is(assignableTo(expectedClass))); }
@Test public void createCoalesceExpression_NullAndObjectOperands_ReturnClassIsString() { Class<?> expectedClass = String.class; Object left = null; Object right = new String(); Expression e = coalesce(left, right); assertThat(e.getResultClass(), is(assignableTo(expectedClass))); }