### Question:
Results { public static final Failed fail() { return fail(null); }  static final Result success(); static final Result success(String message); static final Result success(String message, Object entity); static final Failed fail(); static final Failed fail(String message); static final Failed fail(String message, Throwable e); static final Failed fail(String message, Throwable e, Object entity); static final NavigationResult navigateTo(Class<? extends UICommand> next); static final NavigationResult navigateTo(Class<? extends UICommand>[] next); @SuppressWarnings("unchecked") static final NavigationResult navigateTo(Class<? extends UICommand> next,
            Class<? extends UICommand>... additional); static NavigationResultBuilder navigationBuilder(); static CompositeResult aggregate(Iterable<Result> results); static CompositeResult aggregate(Iterable<Result> results, Object entity);  }### Answer:
@Test public void testFail() { Failed failed = Results.fail(); assertThat(failed.getMessage(), nullValue()); assertThat(failed.getException(), nullValue()); assertThat(failed.getEntity().isPresent(), is(false)); }
@Test public void testFailString() { Failed failed = Results.fail("Foo"); assertThat(failed.getMessage(), equalTo("Foo")); assertThat(failed.getException(), nullValue()); assertThat(failed.getEntity().isPresent(), is(false)); }
@Test public void testFailStringThrowable() { NullPointerException e = new NullPointerException(); Failed failed = Results.fail("Foo", e); assertThat(failed.getMessage(), equalTo("Foo")); assertSame(e, failed.getException()); assertThat(failed.getEntity().isPresent(), is(false)); }
@Test public void testFailStringThrowableObject() { Object anything = new Object(); NullPointerException e = new NullPointerException(); Failed failed = Results.fail("Foo", e, anything); assertThat(failed.getMessage(), equalTo("Foo")); assertSame(e, failed.getException()); assertThat(failed.getEntity().isPresent(), is(true)); assertSame(anything, failed.getEntity().get()); }