Remove randomness in tests
Format code and imports
Ensure that test methods throw exception