public NonClosedTracking<RAW, BASE> trackNonClosed(Input<RAW> rawInput, Input<BASE> baseInput) {
    NonClosedTracking<RAW, BASE> tracking = NonClosedTracking.of(rawInput, baseInput);

    // 1. match by rule, line, line hash and message
    match(tracking, LineAndLineHashAndMessage::new);

    // 2. match issues with same rule, same line and same line hash, but not necessarily with same message
    match(tracking, LineAndLineHashKey::new);

    // 3. detect code moves by comparing blocks of codes
    detectCodeMoves(rawInput, baseInput, tracking);

    // 4. match issues with same rule, same message and same line hash
    match(tracking, LineHashAndMessageKey::new);

    // 5. match issues with same rule, same line and same message
    match(tracking, LineAndMessageKey::new);

    // 6. match issues with same rule and same line hash but different line and different message.
    // See SONAR-2812
    match(tracking, LineHashKey::new);

    return tracking;
  }
@Test
  public void similar_issues_if_trimmed_messages_match() {
    FakeInput baseInput = new FakeInput("H1");
    Issue base = baseInput.createIssueOnLine(1, RULE_SYSTEM_PRINT, "   message  ");

    FakeInput rawInput = new FakeInput("H2");
    Issue raw = rawInput.createIssueOnLine(1, RULE_SYSTEM_PRINT, "message");

    Tracking<Issue, Issue> tracking = tracker.trackNonClosed(rawInput, baseInput);
    assertThat(tracking.baseFor(raw)).isSameAs(base);
  }