This problem appears rather often. Instead of throwing specific exception with no message you should throw IllegalArgumentException
with correct message like
"Initial size is too small :" + startSize
.
For the reference see ArrayList
initialization:
public ArrayList(int initialCapacity) {
super();
if (initialCapacity < 0)
throw new IllegalArgumentException("Illegal Capacity: "+
initialCapacity);
this.elementData = new Object[initialCapacity];
}