Adaptive API Definitions in Java