Ducktyping only with Java