Simple duck typing for Java