class PrefixedSubSequence extends BasedSequenceImpl implements ReplacedBasedSequence {
    final private CharSequence prefix;
    final private BasedSequence base;

    private PrefixedSubSequence(CharSequence prefix, BasedSequence baseSeq, int startIndex, int endIndex) {
        super(0);

        this.prefix = prefix;
        this.base = baseSeq.subSequence(startIndex, endIndex);
    }

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

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

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

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

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

    @NotNull
    @Override
    public BasedSequence baseSubSequence(int startIndex, int endIndex) {
        return base.baseSubSequence(startIndex, endIndex);
    }

    @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();
    }

    @Override
    public int length() {
        return prefix.length() + base.length();
    }

    @Override
    public int getIndexOffset(int index) {<FILL_FUNCTION_BODY>}

    @Override
    public void addSegments(@NotNull IBasedSegmentBuilder<?> builder) {
        if (prefix.length() != 0) {
            builder.append(base.getStartOffset(), base.getStartOffset());
            builder.append(prefix.toString());
        }
        base.addSegments(builder);
    }

    @Override
    public char charAt(int index) {
        SequenceUtils.validateIndex(index, length());

        int prefixLength = prefix.length();
        if (index < prefixLength) {
            return prefix.charAt(index);
        } else {
            return base.charAt(index - prefixLength);
        }
    }

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

        int prefixLength = prefix.length();
        if (startIndex < prefixLength) {
            if (endIndex <= prefixLength) {
                // all from prefix
                return new PrefixedSubSequence(prefix.subSequence(startIndex, endIndex), base.subSequence(0, 0), 0, 0);
            } else {
                // some from prefix some from base
                return new PrefixedSubSequence(prefix.subSequence(startIndex, prefixLength), base, 0, endIndex - prefixLength);
            }
        } else {
            // all from base
            return base.subSequence(startIndex - prefixLength, endIndex - prefixLength);
        }
    }

    @NotNull
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(prefix);
        base.appendTo(sb);
        return sb.toString();
    }

    public static PrefixedSubSequence repeatOf(CharSequence prefix, int count, BasedSequence baseSeq) {
        return prefixOf(RepeatedSequence.repeatOf(prefix, count).toString(), baseSeq, 0, baseSeq.length());
    }

    public static PrefixedSubSequence repeatOf(char prefix, int count, BasedSequence baseSeq) {
        return prefixOf(RepeatedSequence.repeatOf(prefix, count), baseSeq, 0, baseSeq.length());
    }

    public static PrefixedSubSequence prefixOf(CharSequence prefix, BasedSequence baseSeq) {
        return prefixOf(prefix, baseSeq, 0, baseSeq.length());
    }

    public static PrefixedSubSequence prefixOf(CharSequence prefix, BasedSequence baseSeq, int startIndex) {
        return prefixOf(prefix, baseSeq, startIndex, baseSeq.length());
    }

    public static PrefixedSubSequence prefixOf(CharSequence prefix, BasedSequence baseSeq, int startIndex, int endIndex) {
        return new PrefixedSubSequence(prefix, baseSeq, startIndex, endIndex);
    }

    @Deprecated
    public static PrefixedSubSequence of(CharSequence prefix, BasedSequence baseSeq) {
        return prefixOf(prefix, baseSeq);
    }

    @Deprecated
    public static PrefixedSubSequence of(CharSequence prefix, BasedSequence baseSeq, int startIndex) {
        return prefixOf(prefix, baseSeq, startIndex);
    }

    @Deprecated
    public static PrefixedSubSequence of(CharSequence prefix, BasedSequence baseSeq, int startIndex, int endIndex) {
        return prefixOf(prefix, baseSeq, startIndex, endIndex);
    }
}

        SequenceUtils.validateIndexInclusiveEnd(index, length());

        if (index < prefix.length()) {
            // NOTE: to allow creation of segmented sequences from modified original base return -1 for all such modified content positions
            return -1;
        }
        return base.getIndexOffset(index - prefix.length());
    
<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>