Using random get/setstate, and added test