code: @SuppressWarnings("unchecked")
    public static <T> T magicCast(Object obj, T dummy) {
      return (T) obj;
    }
docs: Magically casts the first argument to the type of the second
  argument.
  
  <p>This method is part of the old value type inference trick. It
  is called at run time to cast the old value variable (first
  argument) to the type of an unevaluated version of the old value
  expression (second argument). The "unevaluation" is achieved
  through a constant conditional (for example,
  {@code true ? null : oldExpression}).