DirectDispatchOven extends Oven { @Override public void addDispatcher(String domain, Dispatcher dispatcher) { throw new UnsupportedOperationException("cannot add dispatchers to a DirectDispatchOven"); } DirectDispatchOven(BackendOven backendOven); @Override void setDefaultDispatcher(Dispatcher dispatcher); @Override void addDispatcher(String domain, Dispatcher dispatcher);  }
@Test(expected = UnsupportedOperationException.class) public void testAddDispatcher_throws() { Oven oven = new DirectDispatchOven(new BackendOven()); oven.addDispatcher("FooDomain", payload -> "{}"); }