package com.grayben.riskExtractor.headingMarker;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by beng on 1/12/2015.
 */
public class UnmodifiableText implements EntriesRetrievable<String> {

    private ArrayList<String> stringList;

    public UnmodifiableText(List<String> stringList){
        if(stringList == null)
            throw new NullPointerException("Attempted " +
                    "to construct with null pointer");
        this.stringList = new ArrayList<>(stringList);
    }

    public UnmodifiableText(UnmodifiableText unmodifiableText){
        this(unmodifiableText.getStringList());

    }

    public List<String> getStringList(){
        return Collections.unmodifiableList(this.stringList);
    }

    @Override
    final public List<String> getEntries() {
        return getStringList();
    }
}

@@ -129,16 +129,82 @@
 t;%0A%0A/**%0A
+ * A simple immutable implementation of a list of strings.%0A * %3Cp%3E%0A
  * Creat
@@ -213,12 +213,16 @@
  by 
-beng
+Ben Gray
  on 
@@ -307,16 +307,64 @@
 ing%3E %7B%0A%0A
+    /**%0A     * The string list to wrap.%0A     */%0A
     priv
@@ -367,21 +367,16 @@
 private 
-Array
 List%3CStr
@@ -393,16 +393,128 @@
 gList;%0A%0A
+    /**%0A     * Wrap the specified list of strings.%0A     * @param stringList the list of strings to wrap%0A     */%0A
     publ
@@ -707,69 +707,294 @@
 %22);%0A
-        this.stringList = new ArrayList%3C%3E(stringList);%0A    %7D%0A
+%0A        /**%0A         * Copy %7B@link stringList%7D so that changes do not affect %7B@link #stringList%7D.%0A         */%0A        this.stringList = new ArrayList%3C%3E(stringList);%0A    %7D%0A%0A    /**%0A     * Construct a copy of the specified object.%0A     * @param unmodifiableText the text to copy.%0A     */
 %0A   
@@ -1106,24 +1106,113 @@
 ));%0A%0A    %7D%0A%0A
+    /**%0A     * @return an immutable view of the text encapsulated by this object%0A     */%0A
     public L

Document UnmodifiableText