Check that this expression is assignable to {@code expected}.
546152
@FormatMethod
  public final void checkAssignableTo(Type expected, String fmt, Object... args) {
    if (Flags.DEBUG && !BytecodeUtils.isPossiblyAssignableFrom(expected, resultType())) {
      String message =
          String.format(
              "Type mismatch. %s not assignable to %s.",
              resultType().getClassName(), expected.getClassName());
      if (!fmt.isEmpty()) {
        message = String.format(fmt, args) + ". " + message;
      }

      throw new IllegalArgumentException(message);
    }
  }
1219005
public static ValueExpression createValueExpression(PageContext pageContext, String expression, Class<?> expectedType) {
        ExpressionFactory factory = getExpressionFactory(pageContext);
        return factory.createValueExpression(pageContext.getELContext(), expression, expectedType);
    }
649824
public BindingAssert<T> hasSameValue(ObservableValue<T> expectedValue) {
        new ObservableValueAssertions<>(actual).hasSameValue(expectedValue);
        return this;
    }
152447
def validate(self):
        """"""
        _validate_operator_name(self.operator, UnaryTransformation.SUPPORTED_OPERATORS)

        if not isinstance(self.inner_expression, Expression):
            raise TypeError(u'Expected Expression inner_expression, got {} {}'.format(
                type(self.inner_expression).__name__, self.inner_expression))
1071778
public Token expect(@Nonnull String expected, @Nonnull TokenValidator validator) throws IOException {
        if (!hasNext()) {
            throw eof("Expected %s, got end of file", expected);
        } else if (validator.validate(unreadToken)) {
            lastToken = unreadToken;
            unreadToken = null;
            return lastToken;
        }
        throw failure(unreadToken, "Expected %s, but got '%s'", expected, Strings.escape(unreadToken.asString()));
    }
1080035
function isInstanceOf(value, expectedInstance, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && !(value instanceof expectedInstance)) {
        throw ValueException.unexpectedValue(assertionTypes.INSTANCE_OF, value, expectedInstance, message, id);
    }
}
395603
public void assertEquals(Object expected, Object actual) {
    if (expected == null && actual == null)
      return;
    if (expected != null && expected.equals(actual))
      return;
    fail(format(expected, actual));
  }
205116
static boolean isSignatureAssignable( Class[] from, Class[] to, int round )
    {
        if ( round != JAVA_VARARGS_ASSIGNABLE && from.length != to.length )
            return false;

        switch ( round )
        {
            case JAVA_BASE_ASSIGNABLE:
                for( int i=0; i<from.length; i++ )
                    if ( !isJavaBaseAssignable( to[i], from[i] ) )
                        return false;
                return true;
            case JAVA_BOX_TYPES_ASSIGABLE:
                for( int i=0; i<from.length; i++ )
                    if ( !isJavaBoxTypesAssignable( to[i], from[i] ) )
                        return false;
                return true;
            case JAVA_VARARGS_ASSIGNABLE:
                return isSignatureVarargsAssignable( from, to );
            case BSH_ASSIGNABLE:
                for( int i=0; i<from.length; i++ )
                    if ( !isBshAssignable( to[i], from[i] ) )
                        return false;
                return true;
            default:
                throw new InterpreterError("bad case");
        }
    }
1032186
def contains(self, expected):
        

        return self._encode_invoke(atomic_reference_contains_codec,
                                   expected=self._to_data(expected))
881577
public static void assertEquals(float expected, float actual, float delta) {
        assertEquals(expected, actual, delta, "Expected " + expected + " +- " + delta + " but got " + actual);
    }
1186480
boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
        DeferredChecker dc = new DeferredChecker(env);
        dc.scan(expr);
        return dc.result.isPoly();
    }
1136444
private static boolean validateReturnType(Method method, Class<?> expected) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class) {
      return false;
    }
    if (returnType != expected) {
      String expectedType = "'" + expected.getName() + "'";
      if (expected != void.class) {
        expectedType = "'void' or " + expectedType;
      }
      throw new IllegalStateException(method.getDeclaringClass().getName()
          + "."
          + method.getName()
          + " must have return type of "
          + expectedType);
    }
    return true;
  }
778821
public static void assertEquals(String message, Object expected, Object actual) {
        if (expected == null && actual != null || expected != null && !expected.equals(actual)) {
            fail(message);
        }
    }
1186641
@Nonnull
    public Token expect(@Nonnull String expected) throws IOException {
        if (!hasNext()) {
            throw eof("Expected %s: Got end of file", expected);
        }
        lastToken = unreadToken;
        unreadToken = null;
        return lastToken;
    }
251015
function(expectedType, value) {
  var actualType = getType(value);
  if (expectedType!== actualType) {
    throw new TypeError('Expected type to be ' +
      expectedType + ', but got ' + actualType);
  }
  return value;
}
1209383
def validate(self):
        """"""
        if not isinstance(self.predicate, Expression):
            raise TypeError(u'Expected Expression predicate, got: {} {}'.format(
                type(self.predicate).__name__, self.predicate))
        if not isinstance(self.if_true, Expression):
            raise TypeError(u'Expected Expression if_true, got: {} {}'.format(
                type(self.if_true).__name__, self.if_true))
        if not isinstance(self.if_false, Expression):
            raise TypeError(u'Expected Expression if_false, got: {} {}'.format(
                type(self.if_false).__name__, self.if_false))
1262996
function assert (value, expected, method, type, identifier) {
    if (value !== expected) {
      throw new Error(method + ' only accepts ' + type + ' as ' + identifier);
    }
  }