so, i found souliton finally:
// getting the result from ResultFormatter class
String result = ResultFormatter.format(times, racers);
// clearing all the spaces and line breaks for reliable comparison
String cleanExpected = expected.replace("\u00A0", " ").replaceAll("\\r\\n", "\n").trim();
String cleanResult = result.replace("\u00A0", " ").replaceAll("\\r\\n", "\n").trim();
assertEquals(cleanExpected, cleanResult);
}