Alias for {@link #that(Object, org.hamcrest.Matcher)} intended for use in then-blocks.

@param value the actual value
@param matcher a matcher describing the expected value
@param <T> the actual value's type
960080
@SuppressWarnings("UnusedDeclaration")
  public static <T> void expect(T value, Matcher<? super T> matcher) {
    that(value, matcher);
  }
54065
public HttpClientVerifyBuilder withParameter(String name, Matcher<String> matcher) {
        ruleBuilder.addParameterCondition(name, matcher);
        return this;
    }
102508
public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) {
        checkSucceeds(new Callable<Object>() {
            public Object call() throws Exception {
                assertThat(reason, value, matcher);
                return value;
            }
        });
    }
313112
public static <T extends Tree> Matcher<T> anyOf(
      final Iterable<? extends Matcher<? super T>> matchers) {
    return new Matcher<T>() {
      @Override
      public boolean matches(T t, VisitorState state) {
        for (Matcher<? super T> matcher : matchers) {
          if (matcher.matches(t, state)) {
            return true;
          }
        }
        return false;
      }
    };
  }
1349225
public boolean isMatched(String value, Boolean defaultValue)
    {
        if (value == null)
            return false;

        if (_match != null) {
            for (int i = 0; i < _match.length; i++) {
                if (value.equals(_match[i]))
                    return true;
            }
        }
        else {
            // a provided default value will override the group
            if (defaultValue != null)
                return defaultValue.booleanValue();

            // if we have a singleton definition then use that
            if (_defaultSingleton)
                return _defaultSingleValue;

            // check to see if we have a default arraylist with the value in it
            if (_defaultSelections != null)
                return _defaultSelections.contains(value);
        }

        return false;
    }
637860
static Matcher head(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      List<Matcher> ms = matcher.<SeqMatcher>as().matchers();
      return ms.get(0);
    } else {
      return matcher;
    }
  }
930624
public boolean isMatched(String value, Boolean defaultValue)
    {
        // @todo: there isn't a defaultValue for radio button, what should we do here?
        if (value == null)
            return false;
        if (_match != null)
            return value.equals(_match);
        if (_defaultRadio != null)
            return value.equals(_defaultRadio);

        return false;
    }
563564
def resolve(self, value=None):
        

        # If we still have an uninitialized matcher init it now
        if self.matcher:
            self._init_matcher()

        # Evaluate the current set of matchers forming the expression
        matcher = self.evaluate()

        try:
            value = self._transform(value)
            self._assertion(matcher, value)
        except AssertionError as ex:
            # By re-raising here the exception we reset the traceback
            raise ex
        finally:
            # Reset the state of the object so we can use it again
            if self.deferred:
                self.reset()
641539
@Override
    public boolean contains(Object value) {
        final Iterator<Comparable> iter = new StepIterator(this, 1);
        if (value == null) {
            return false;
        }
        while (iter.hasNext()) {
            if (DefaultTypeTransformation.compareEqual(value, iter.next())) return true;
        }
        return false;
    }
65800
public boolean isPrefixOf(MatcherPath that) {
        checkArgNotNull(that, "that");
        return element.level <= that.element.level &&
                (this == that || (that.parent != null && isPrefixOf(that.parent)));
    }
508799
public static Matcher<ContextElement> attributes(final Matcher<Map<String, Object>> matcher) {
    return new Matcher<ContextElement>() {

      @Override
      protected boolean matchesSafely(ContextElement t) {
        return matcher.matches(t.attributes());
      }

      @Override
      public String toString() {
        return "an attributes " + matcher;
      }
    };
  }
1314487
@Override
    public <I> MatchResult<I> matchResult(I item) {
        StringDescription mismatch = new StringDescription();
        if (matches(item, mismatch)) {
            return new MatchResultSuccess<>(item, this);
        } else {
            return new MatchResultMismatch<>(item, this, mismatch.toString());
        }
    }
597784
boolean matchText(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This text has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesText(markupBlockIndex, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchText(blockMatching, markupLevel, markupBlockIndex);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchText(blockMatching, markupLevel, markupBlockIndex);
            }
            return blockMatching;

        }

        return false;

    }
38338
public static <T extends Throwable> Matcher<T> withMessage(Matcher<String> matcher) {
        return IsThrowable.withMessage(matcher);
    }
105944
public static  Matcher unwrap(Matcher matcher) {
        if (matcher instanceof VarFramingMatcher) {
            VarFramingMatcher varFramingMatcher = (VarFramingMatcher) matcher;
            return unwrap(varFramingMatcher.inner);
        }
        return matcher;
    }
790956
public <U extends T> InitialMatching0<T, U> when(
      DecomposableMatchBuilder0<U> decomposableMatchBuilder) {
    return new InitialMatching0<>(decomposableMatchBuilder.build(), value);
  }
278740
public MatcherPath commonPrefix(MatcherPath that) {
        checkArgNotNull(that, "that");
        if (element.level > that.element.level) return parent.commonPrefix(that);
        if (element.level < that.element.level) return commonPrefix(that.parent);
        if (this == that) return this;
        return (parent != null && that.parent != null) ? parent.commonPrefix(that.parent) : null;
    }