preventing null pointer exception in Robolectric tests