@Test
public void testURLResponse() throws Exception {

  final URLResponse urlResponse = mock(URLResponse.class);
  doNothing().when(urlResponse).refreshContents();
  when(urlResponse.indicatesSuccess()).thenCallRealMethod();
  when(urlResponse.indicatesError()).thenCallRealMethod();
  doCallRealMethod().when(urlResponse).setURLContents(anyString());
  urlResponse.setURLContents("Success");
  assertThat(urlResponse.indicatesSuccess()).isTrue();
  assertThat(urlResponse.indicatesError()).isFalse();
  urlResponse.setURLContents("Error");
  assertThat(urlResponse.indicatesError()).isTrue();
  assertThat(urlResponse.indicatesSuccess()).isFalse();
}