Java framework for switching between strategies