@Test
public void onLogLineReceived() {

  LogcatListener listener = new TestFormattedLogcatReceiver();
  Instant timestamp = Instant.parse("2018-04-17T20:33:25.907Z");
  LogCatHeader header1 = new LogCatHeader(LogLevel.INFO, 28740, 28740, "com.google.myapplication", "MainActivity", timestamp);
  listener.onLogLineReceived(new LogCatMessage(header1, "Log 1"));
  LogCatHeader header2 = new LogCatHeader(LogLevel.INFO, 28740, 28740, "com.google.myapplication", "MainActivity", timestamp);
  listener.onLogLineReceived(new LogCatMessage(header2, "Log 2"));
  Object expected = "2018-04-17 13:33:25.907 28740-28740/com.google.myapplication I/MainActivity: Log 1\n" +
                    "2018-04-17 13:33:25.907 28740-28740/com.google.myapplication I/MainActivity: Log 2\n";
  assertEquals(expected, listener.toString());
}