I'm asked to refactor my component code to support A/B Testing.
What is the better approach:
1) Pass a boolean value to the methods and check for that flag inside the method body?
method(flag abTest): if A_VERSION_ENABLED: // Do 'A' logic else // Do 'B' logic
2) Create dedicated methods for each version?