Added support for Robolectric and modified tests to suit it