@Test
void shouldHandleMalformedInputException() {

    TaskScanner scanner = new TaskScannerBuilder().build();
    Path pathToFile = getResourceAsFile("file-with-strange-characters.txt");
    Report report = scanner.scan(pathToFile, StandardCharsets.UTF_8);
    assertThat(report.getErrorMessages()).isNotEmpty().contains("Can't read source file '"
            + pathToFile.toString()
            + "', defined encoding 'UTF-8' seems to be wrong");
}