On PPCG, we frequently have King of the Hill challenges, which pit different code bots against each other.  We don't like limiting these challenges to a single language, so we do cross-platform communication over standard I/O.My goal is to write a framework that challenge-writers will be able use to make writing these challenges easier.  I've come up with the following requirements I'd like to fulfill:The challenge-writer is able to make a class where methods represent each of the distinct communications.  For example, on our Good vs Evil challenge, the writer would make a Player class that has an abstract boolean vote(List<List<Boolean>> history) method on it.The controller is able to provide instances of the above class that communicate via standard I/O when the aformentioned methods are called.  That said, not all instances of the above class will necessarily communicate over standard I/O.  3 of the bots may be native Java bots (that simply override the Player class, where another 2 are in another language)The methods won't always have the same number of arguments (nor will they always have a return value)I'd like the challenge-writer to have to do as little work as possible to work with my framework.I'm not against using reflection to solve these problems.  I've considered requiring the challenge writer to do something like:class PlayerComm extends Player {    private Communicator communicator;    public PlayerComm(Communicator communicator){        this.communicator = communicator;    }    @Override    boolean vote(List<List<Boolean>> history){         return (Boolean)communicator.sendMessage(history);    }}but if there are several methods, this can get pretty repetitive, and the constant casting isn't fun.  (sendMessage in this example would accept a variable number of Object arguments, and return an Object)Is there a better way to do this?
Code Design: Delegation of arbitrary functions
java;design;delegation