Small utility for using ducktyping in java