### Question:
EndpointIfAlreadyExists implements Fallback<URI>, InvocationContext<EndpointIfAlreadyExists> { @Override public URI createOrPropagate(Throwable t) throws Exception { if (checkNotNull(t, "throwable") instanceof KeyAlreadyExistsException) { return endpoint; } throw propagate(t); }  @Override URI createOrPropagate(Throwable t); @Override EndpointIfAlreadyExists setContext(HttpRequest request);  }### Answer:
@Test public void testFoundIsNullWhenEndpointNotSet() throws Exception { assertNull(new EndpointIfAlreadyExists().createOrPropagate(new KeyAlreadyExistsException())); }
@Test(expectedExceptions = RuntimeException.class) public void testNotFoundPropagates() throws Exception { new EndpointIfAlreadyExists().createOrPropagate(new RuntimeException()); }
@Test(expectedExceptions = NullPointerException.class) public void testNullIsBad() throws Exception { new EndpointIfAlreadyExists().createOrPropagate(null); }