Source:
public void implementationMustOverrideMethods() throws IOException { final XnioWorker xnioWorker = new XnioWorker(Xnio.getInstance(), Thread.currentThread().getThreadGroup(), OptionMap.EMPTY, new Runnable() {public void run() {}}) { @Override public void shutdown() @Override public List<Runnable> shutdownNow() {return null;} @Override public boolean isShutdown() {return false;} @Override public boolean isTerminated() {return false;} @Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { return false; } @Override public void awaitTermination() throws InterruptedException { } @Override public XnioIoThread getIoThread(final int hashCode) { return new XnioIoThreadMock(this); } @Override public int getIoThreadCount() { return 0; } @Override protected XnioIoThread chooseThread() { return new XnioIoThreadMock(this); } @Override public XnioWorkerMXBean getMetrics() { return null; } @Override protected Closeable registerServerMetrics(XnioServerMXBean metrics) { return null; } }; UnsupportedOperationException expected = null; try { xnioWorker.createStreamConnectionServer(new InetSocketAddress(1000), null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); expected = null; try { xnioWorker.createStreamConnectionServer(new LocalSocketAddress("server"), null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); expected = null; try { xnioWorker.createUdpServer(null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); }

Target:
public void implementationMustOverrideMethods() throws IOException { final XnioWorker xnioWorker = new XnioWorker(Xnio.getInstance(), Thread.currentThread().getThreadGroup(), OptionMap.EMPTY, new Runnable() {public void run() {}}) { @Override public void shutdown() @Override public List<Runnable> shutdownNow() {return null;} @Override public boolean isShutdown() {return false;} @Override public boolean isTerminated() {return false;} @Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { return false; } @Override public void awaitTermination() throws InterruptedException { } @Override public XnioIoThread getIoThread(final int hashCode) { return new XnioIoThreadMock(this); } @Override public int getIoThreadCount() { return 0; } @Override protected XnioIoThread chooseThread() { return new XnioIoThreadMock(this); } @Override public XnioWorkerMXBean getMXBean() { return null; } @Override protected ManagementRegistration registerServerMXBean(XnioServerMXBean metrics) { return null; } }; UnsupportedOperationException expected = null; try { xnioWorker.createStreamConnectionServer(new InetSocketAddress(1000), null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); expected = null; try { xnioWorker.createStreamConnectionServer(new LocalSocketAddress("server"), null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); expected = null; try { xnioWorker.createUdpServer(null, null); } catch (UnsupportedOperationException e) { expected = e; } assertNotNull(expected); }