class MappedBasedSequence extends BasedSequenceImpl implements MappedSequence<BasedSequence>, ReplacedBasedSequence {
    final private CharMapper mapper;
    final private BasedSequence baseSeq;

    private MappedBasedSequence(BasedSequence baseSeq, CharMapper mapper) {
        super(0);

        this.baseSeq = baseSeq;
        this.mapper = mapper;
    }

    @NotNull
    @Override
    public CharMapper getCharMapper() {
        return mapper;
    }

    @Override
    public char charAt(int index) {
        return mapper.map(baseSeq.charAt(index));
    }

    @NotNull
    @Override
    public BasedSequence getCharSequence() {
        return baseSeq;
    }

    @Override
    public int length() {
        return baseSeq.length();
    }

    @Override
    public @NotNull BasedSequence toMapped(CharMapper mapper) {
        return mapper == CharMapper.IDENTITY ? this : new MappedBasedSequence(baseSeq, this.mapper.andThen(mapper));
    }

    @Override
    public int getOptionFlags() {
        return getBaseSequence().getOptionFlags();
    }

    @Override
    public boolean allOptions(int options) {
        return getBaseSequence().allOptions(options);
    }

    @Override
    public boolean anyOptions(int options) {
        return getBaseSequence().anyOptions(options);
    }

    @Override
    public <T> T getOption(DataKeyBase<T> dataKey) {
        return getBaseSequence().getOption(dataKey);
    }

    @Override
    public @Nullable DataHolder getOptions() {
        return getBaseSequence().getOptions();
    }

    @NotNull
    @Override
    public BasedSequence sequenceOf(@Nullable CharSequence baseSeq, int startIndex, int endIndex) {<FILL_FUNCTION_BODY>}

    @NotNull
    @Override
    public BasedSequence subSequence(int startIndex, int endIndex) {
        SequenceUtils.validateStartEnd(startIndex, endIndex, length());

        if (startIndex == 0 && endIndex == baseSeq.length()) {
            return this;
        }
        return new MappedBasedSequence(baseSeq.subSequence(startIndex, endIndex), mapper);
    }

    @NotNull
    @Override
    public Object getBase() {
        return baseSeq.getBase();
    }

    @NotNull
    @Override
    public BasedSequence getBaseSequence() {
        return baseSeq.getBaseSequence();
    }

    @Override
    public int getStartOffset() {
        return baseSeq.getStartOffset();
    }

    @Override
    public int getEndOffset() {
        return baseSeq.getEndOffset();
    }

    @Override
    public int getIndexOffset(int index) {
        return baseSeq.charAt(index) == charAt(index) ? baseSeq.getIndexOffset(index) : -1;
    }

    @Override
    public void addSegments(@NotNull IBasedSegmentBuilder<?> builder) {
        BasedUtils.generateSegments(builder, this);
    }

    @NotNull
    @Override
    public Range getSourceRange() {
        return baseSeq.getSourceRange();
    }

    @NotNull
    public static BasedSequence mappedOf(@NotNull BasedSequence baseSeq, @NotNull CharMapper mapper) {
        return new MappedBasedSequence(baseSeq, mapper);
    }
}

        if (baseSeq instanceof MappedBasedSequence) {
            return startIndex == 0 && endIndex == baseSeq.length() ? (BasedSequence) baseSeq : ((BasedSequence) baseSeq).subSequence(startIndex, endIndex).toMapped(mapper);
        } else return new MappedBasedSequence(this.baseSeq.sequenceOf(baseSeq, startIndex, endIndex), mapper);
    
<methods>public void <init>(int) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>) ,public int baseColumnAtEnd() ,public int baseColumnAtIndex(int) ,public int baseColumnAtStart() ,public int baseEndOfLine(int) ,public int baseEndOfLine() ,public int baseEndOfLineAnyEOL(int) ,public int baseEndOfLineAnyEOL() ,public @NotNull Pair<Integer,Integer> baseLineColumnAtEnd() ,public @NotNull Pair<Integer,Integer> baseLineColumnAtIndex(int) ,public @NotNull Pair<Integer,Integer> baseLineColumnAtStart() ,public @NotNull Range baseLineRangeAtEnd() ,public @NotNull Range baseLineRangeAtIndex(int) ,public @NotNull Range baseLineRangeAtStart() ,public int baseStartOfLine(int) ,public int baseStartOfLine() ,public int baseStartOfLineAnyEOL(int) ,public int baseStartOfLineAnyEOL() ,public final @NotNull BasedSequence baseSubSequence(int) ,public @NotNull BasedSequence baseSubSequence(int, int) ,public boolean containsAllOf(@NotNull BasedSequence) ,public boolean containsOnlyIn(@NotNull CharPredicate) ,public boolean containsOnlyNotIn(@NotNull CharPredicate) ,public boolean containsSomeIn(@NotNull CharPredicate) ,public boolean containsSomeNotIn(@NotNull CharPredicate) ,public boolean containsSomeOf(@NotNull BasedSequence) ,public @NotNull BasedSequence [] emptyArray() ,public @NotNull BasedSequence extendByAny(@NotNull CharPredicate) ,public @NotNull BasedSequence extendByAny(@NotNull CharPredicate, int) ,public @NotNull BasedSequence extendByAnyNot(@NotNull CharPredicate) ,public @NotNull BasedSequence extendByAnyNot(@NotNull CharPredicate, int) ,public @NotNull BasedSequence extendByOneOfAny(@NotNull CharPredicate) ,public @NotNull BasedSequence extendByOneOfAnyNot(@NotNull CharPredicate) ,public final @NotNull BasedSequence extendToEndOfLine(@NotNull CharPredicate) ,public final @NotNull BasedSequence extendToEndOfLine(boolean) ,public final @NotNull BasedSequence extendToEndOfLine() ,public final @NotNull BasedSequence extendToEndOfLine(@NotNull CharPredicate, boolean) ,public final @NotNull BasedSequence extendToStartOfLine(@NotNull CharPredicate) ,public final @NotNull BasedSequence extendToStartOfLine(boolean) ,public final @NotNull BasedSequence extendToStartOfLine() ,public @NotNull BasedSequence extendToStartOfLine(@NotNull CharPredicate, boolean) ,public static transient com.vladsch.flexmark.util.sequence.BasedSequence firstNonNull(com.vladsch.flexmark.util.sequence.BasedSequence[]) ,public @NotNull SequenceBuilder getBuilder() ,public @NotNull BasedSequence getEmptyPrefix() ,public @NotNull BasedSequence getEmptySuffix() ,public @NotNull SegmentTree getSegmentTree() ,public @NotNull BasedSequence intersect(@NotNull BasedSequence) ,public boolean isBaseCharAt(int, @NotNull CharPredicate) ,public boolean isContinuationOf(@NotNull BasedSequence) ,public boolean isContinuedBy(@NotNull BasedSequence) ,public @NotNull BasedSequence normalizeEOL(@NotNull ReplacedTextMapper) ,public @NotNull BasedSequence normalizeEndWithEOL(@NotNull ReplacedTextMapper) ,public @NotNull BasedSequence nullSequence() ,public @NotNull BasedSequence prefixOf(@NotNull BasedSequence) ,public @NotNull BasedSequence prefixWith(@Nullable CharSequence) ,public final @NotNull BasedSequence prefixWithIndent() ,public @NotNull BasedSequence prefixWithIndent(int) ,public char safeBaseCharAt(int) ,public char safeCharAt(int) ,public @NotNull BasedSequence sequenceOf(@Nullable CharSequence, int, int) ,public @NotNull BasedSequence spliceAtEnd(@NotNull BasedSequence) ,public @NotNull BasedSequence suffixOf(@NotNull BasedSequence) ,public @NotNull BasedSequence toMapped(com.vladsch.flexmark.util.sequence.mappers.CharMapper) ,public @Nullable String toStringOrNull() ,public @NotNull String unescape() ,public @NotNull BasedSequence unescape(@NotNull ReplacedTextMapper) ,public @NotNull String unescapeNoEntities() <variables>