Sentence implements AbstractServerSocket<Sentence> { public Sentence execute(SerializableAction<ServerSocket> action) { server.find(predicate, action); return this; } Sentence(Server server, ServerSocketPredicate predicate); Sentence find(ServerSocketPredicate predicate); Sentence execute(SerializableAction<ServerSocket> action); @Override Sentence send(String event, Object data); @Override void close(); @Override Sentence tag(String... names); @Override Sentence untag(String... names);  }
@Test public void execute() { Server server = new DefaultServer() { @Override public Server find(ServerSocketPredicate predicate, SerializableAction<ServerSocket> action) { assertSame(NOOP_PREDICATE, predicate); assertSame(NOOP_ACTION, action); return this; } }; server.find(NOOP_PREDICATE).execute(NOOP_ACTION); }