ClusteredServer extends DefaultServer { public Server onpublish(Action<Map<String, Object>> action) { publishActions.add(action); return this; }  @Override Server find(ServerSocketPredicate predicate, SerializableAction<ServerSocket> action); Server onpublish(Action<Map<String, Object>> action); Action<Map<String, Object>> messageAction();  }
@Test public void onpublish() { ClusteredServer server = new ClusteredServer(); server.onpublish(map -> { assertEquals(NOOP_PREDICATE, map.get("predicate")); assertEquals(NOOP_ACTION, map.get("action")); }); server.find(NOOP_PREDICATE, NOOP_ACTION); }