void (String textWithBoundaryMarkers, String fileExtension) { java.util.List<Integer> expectedBoundaryPositions = new ArrayList<>(); StringBuilder rawTextBuilder = new StringBuilder(); for (int i = 0; i < textWithBoundaryMarkers.length(); i++) { char c = textWithBoundaryMarkers.charAt(i); if (c == BIDI_BOUNDARY_MARKER) { expectedBoundaryPositions.add(rawTextBuilder.length()); } else { rawTextBuilder.append(c); } } String rawText = rawTextBuilder.toString(); configureFromFileText(getTestName(false) + "." + fileExtension, rawText.replace(RTL_CHAR_REPRESENTATION, RTL_CHAR)); java.util.List<Integer> actualBoundaryPositions = new ArrayList<>(); for (int i = 1; i < rawText.length(); i++) { if (!getEditor().offsetToVisualPosition(i, false, false).equals( getEditor().offsetToVisualPosition(i, true, false))) { actualBoundaryPositions.add(i); } } assertEquals("Unexpected bidi regions boundaries' positions", expectedBoundaryPositions, actualBoundaryPositions); }