Added JUnit tests, normalised database, then refactored tests to match.