Context { protected static String getApiKey(){ if (apiKey == null) { throw new RuntimeException("You must set the API key first."); } return apiKey; }  static void setApiKey(String apiKey);  }
@Test public void getApiKey_ShouldThrowExceptionWhenThereIsNoApiKey() { thrown.expect(RuntimeException.class); thrown.expectMessage("You must set the API key first."); Context.getApiKey(); }