Extracted common jUnit rule functionality to common superclass.