@Test
public void testParseAllLogLevelsAndHexThreadIds() {

  String[] messages = new String[]{
    "[ 1534039867.132   495:0x1ef D/dtag     ]",
    "debug message",
    "[ 1534039867.132   495:  234 E/etag     ]",
    "error message",
    "[ 1534039867.132   495:0x1ef I/itag     ]",
    "info message",
    "[ 1534039867.132   495:0x1ef V/vtag     ]",
    "verbose message",
    "[ 1534039867.132   495:0x1ef W/wtag     ]",
    "warning message",
    "[ 1534039867.132   495:0x1ef F/wtftag   ]",
    "wtf message",
    "[ 1534047335.754   540:0x21c D/debug tag    ]",
    "debug message",
    "[ 1534047335.754   540:0x21c I/tag:with:colons ]",
    "message:with:colons",
  };
  for (String message : messages) {
    myReceiver.processNewLine(message);
  }
  String expected = "2018-08-11 19:11:07.132 495-495/? D/dtag: debug message\n" +
                    "2018-08-11 19:11:07.132 495-234/? E/etag: error message\n" +
                    "2018-08-11 19:11:07.132 495-495/? I/itag: info message\n" +
                    "2018-08-11 19:11:07.132 495-495/? V/vtag: verbose message\n" +
                    "2018-08-11 19:11:07.132 495-495/? W/wtag: warning message\n" +
                    "2018-08-11 19:11:07.132 495-495/? A/wtftag: wtf message\n" +
                    // NOTE: "debug tag" uses a special-case "no break" space character
                    "2018-08-11 21:15:35.754 540-540/? D/debug tag: debug message\n" +
                    "2018-08-11 21:15:35.754 540-540/? I/tag:with:colons: message:with:colons\n";
  assertThat(myLogcatListener.toString()).isEqualTo(expected);
}