Refactor + use mockito for StatefulRuleTest