package com.grayben.riskExtractor.headingMarker;

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

/**
 * Created by beng on 1/12/2015.
 */
public class UnmodifiableText {

    private List<String> stringList;

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

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

    }

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

package com.grayben.riskExtractor.headingMarker;

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

/**
 * Created by beng on 1/12/2015.
 */
public class UnmodifiableText {

    private List<String> stringList;

    public UnmodifiableText(List<String> stringList){
        this.stringList = stringList;
    }

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

    }

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

--- 
+++ 
@@ -11,11 +11,14 @@
     private List<String> stringList;
 
     public UnmodifiableText(List<String> stringList){
+        if(stringList == null)
+            throw new NullPointerException("Attempted " +
+                    "to construct with null pointer");
         this.stringList = stringList;
     }
 
     public UnmodifiableText(UnmodifiableText unmodifiableText){
-        this.stringList = unmodifiableText.getStringList();
+        this(unmodifiableText.getStringList());
 
     }
 
Make constructor throw NullPointerException where appropriate
