Refactor CommandTask classes to be immutable

No match.