moved test related methods of Domain object to trait