class Error {
  
  private final int startPos;
  private final int endPos;
  private final String correction;

  Error(int startPos, int endPos, String correction) {
    if (endPos < startPos) {
      throw new RuntimeException("end pos < start pos: " + endPos + " < " + startPos);
    }
    this.startPos = startPos;
    this.endPos = endPos;
    this.correction = correction;
  }

  public int getStartPos() {
    return startPos;
  }

  public int getEndPos() {
    return endPos;
  }

  public String getCorrection() {
    return correction;
  }

  public String getAppliedCorrection(String markupText) {<FILL_FUNCTION_BODY>}

  @Override
  public String toString() {
    return startPos + "-" + endPos + ":" + correction;
  }
}

    try {
      String correctionApplied = markupText.substring(0, startPos) + correction + markupText.substring(endPos);
      return correctionApplied.replaceAll("<.*?>", "");
    } catch (Exception e) {
      throw new RuntimeException("Could not get substrings 0-" + startPos + " and " + endPos + "-end: " + markupText);
    }
  
<no_super_class>