/**
 * Copyright (c) 2014-2015, Kristian Klette
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met: 1) Redistributions of source code must retain the above
 * copyright notice, this list of conditions and the following
 * disclaimer. 2) Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution. 3) Neither the name of the Qulice.com nor
 * the names of its contributors may be used to endorse or promote
 * products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package us.klette.constantstring;

import us.klette.constantstring.internal.CStringConcat;
import us.klette.constantstring.internal.CStringSub;
import us.klette.constantstring.internal.CStringSubRange;

/**
 * The CString interface defines the allowed operations
 * within ConstantString.
 * <p>
 * This is a small utility library for doing constant time string manipulation.
 * Or in simpler terms, you can do operations on strings that are done in a
 * fixed time, and delay the linear time computation until you evaluate your
 * set of operations.
 *
 * @author Kristian Klette (klette@klette.us)
 */
public interface CString {
    /**
     * Evaluates the CString into a String.
     *
     * @return The resulting {@link String} instance.
     */
    @Override
    String toString();

    /**
     * Applies a substring operations similar to
     * {@link java.lang.String#substring(int)}.
     *
     * @param index The index of which to start the new string
     * @return The CString representation after the applied substring operation
     */
    default CString substring(int index) {
        return new CStringSub(this, index);
    }
    /**
     * Applies a substring operations similar to
     * {@link java.lang.String#substring(int, int)}.
     *
     * @param index The index of which to start the new string
     * @param end The end index of the substring
     * @return The CString representation after the applied substring operation
     */
    default CString substring(int index, int end) {
        return new CStringSubRange(this, index, end);
    }

    /**
     * Append another CString after the current instance.
     *
     * @param other The instance to be appended.
     * @return The CString representation of the two
     */
    default CString concat(CString other) {
        return new CStringConcat(this, other);
    }

    /**
     * Delete a subsection of the String.
     *
     * @param start The start index of the delete
     * @param end The end index of the deleted part
     */
    default CString delete(int start, int end) {
        return new CStringConcat(
                new CStringSubRange(this, 0, start),
                new CStringSub(this, start+end)
        );
    }

    /**
     * Insert the given CString at the given index.
     *
     * @param other The CString to insert
     * @param index The position where the string should be inserted
     * @return The resulting CString representation
     */
    default CString insert(final CString other, final int index) {
        return this.substring(0, index)
                .concat(other)
                .concat(this.substring(index));
    }
}

@@ -2637,32 +2637,38 @@
 tring substring(
+final 
 int index) %7B%0A   
@@ -2656,32 +2656,32 @@
 al int index) %7B%0A
-
         return n
@@ -3061,16 +3061,22 @@
 bstring(
+final 
 int inde
@@ -3077,16 +3077,22 @@
 t index,
+ final
  int end
@@ -3366,16 +3366,22 @@
  concat(
+final 
 CString 
@@ -3637,16 +3637,22 @@
  delete(
+final 
 int star
@@ -3653,16 +3653,22 @@
 t start,
+ final
  int end

Add final keyword on interface default methods