@Test
public void parseWithWarningNoSource() {

  String line = "AGPBI: {\"kind\":\"warning\",\"text\":\"Warning message.\",\"sources\":[{}],\"tool\":\"D8\"}";
  when(myReader.getParentEventId()).thenReturn("BUILD_ID_MOCK");
  ArgumentCaptor<MessageEvent> messageCaptor = ArgumentCaptor.forClass(MessageEvent.class);
  String detailLine = "This is a detail line";
  assertTrue(myParser.parse(line, myReader, myConsumer));
  assertFalse(myParser.parse(detailLine, myReader, myConsumer));
  verify(myConsumer).accept(messageCaptor.capture());
  List<MessageEvent> generatedMessages = messageCaptor.getAllValues();
  assertThat(generatedMessages).hasSize(1);
  assertThat(generatedMessages.get(0)).isNotInstanceOf(FileMessageEvent.class);
  MessageEvent messageEvent = generatedMessages.get(0);
  assertThat(messageEvent.getGroup()).isEqualTo("D8 warnings");
  assertThat(messageEvent.getKind()).isEqualTo(MessageEvent.Kind.WARNING);
  assertThat(messageEvent.getResult().getDetails()).isEqualTo("Warning message.");
}