TelnetHandler { protected void onSize(int width, int height) {}    }
@Test public void testRejectNAWS() throws Exception { final AtomicReference<Boolean> serverValue = new AtomicReference<>(); WindowSizeOptionHandler optionHandler = new WindowSizeOptionHandler(20, 10, false, false, false, false); testOptionValue(new Supplier<TelnetHandler>() { @Override public TelnetHandler get() { return new TelnetHandler() { @Override protected void onOpen(TelnetConnection conn) { conn.writeDoOption(Option.NAWS); } @Override protected void onNAWS(boolean naws) { serverValue.set(naws); testComplete(); } @Override protected void onSize(int width, int height) { super.onSize(width, height); } }; } }, optionHandler); assertEquals(false, serverValue.get()); assertEquals(false, optionHandler.getAcceptLocal()); }