This is basic object orientation: You pass in an object that corresponds to the desired interface. "Facade pattern" if you need something to Google, but this is really basic language-agnostic OO stuff.
Another reason to dislike the Java cruft; it successfully hides the simple things going on behind immense machinery and complicated terminology.
Another reason to dislike the Java cruft; it successfully hides the simple things going on behind immense machinery and complicated terminology.