@Test public void assertIsSome_throwsAssertionError_whenNone() { thrown.expect(AssertionError.class); thrown.expectMessage(startsWith("Option was not Some")); new OptionAssertion<Object>(Option.none()).assertIsSome(); }
@NotNull public OptionAssertion<T> assertIsSome() { if (!actual.isSome()) { throw fail("Option was not Some"); } return this; }
OptionAssertion { @NotNull public OptionAssertion<T> assertIsSome() { if (!actual.isSome()) { throw fail("Option was not Some"); } return this; } }
OptionAssertion { @NotNull public OptionAssertion<T> assertIsSome() { if (!actual.isSome()) { throw fail("Option was not Some"); } return this; } OptionAssertion(@NotNull final Option<T> actual); }
OptionAssertion { @NotNull public OptionAssertion<T> assertIsSome() { if (!actual.isSome()) { throw fail("Option was not Some"); } return this; } OptionAssertion(@NotNull final Option<T> actual); void assertIsNone(); @NotNull OptionAssertion<T> assertIsSome(); @NotNull OptionAssertion<T> assertValue(@NotNull final T expected); @NotNull OptionAssertion<T> assertValue(@NotNull final Func1<T, Boolean> predicate); }
OptionAssertion { @NotNull public OptionAssertion<T> assertIsSome() { if (!actual.isSome()) { throw fail("Option was not Some"); } return this; } OptionAssertion(@NotNull final Option<T> actual); void assertIsNone(); @NotNull OptionAssertion<T> assertIsSome(); @NotNull OptionAssertion<T> assertValue(@NotNull final T expected); @NotNull OptionAssertion<T> assertValue(@NotNull final Func1<T, Boolean> predicate);  }