Class Unsafe


public class Unsafe extends Object
Contains methods that call JDK methods that the forbidden APIs checker does not approve of.

This class is excluded from the check, so methods called via this class will not fail the build.

  • Method Details

    • matches

      public static <T> boolean matches(org.hamcrest.Matcher<T> matcher, Object actual)
      Matcher.matches(Object) is forbidden in regular test code in favour of MatcherAssert.assertThat(T, org.hamcrest.Matcher<? super T>). Note: Matcher#matches is still useful when testing matcher implementations.
      matcher - matcher
      actual - actual value
      the result of matcher.matches(actual)