There is some confusion with the naming here. If I construct something with a parameter called "initialSize", then I expect it to return this value when asking for size(). It seems you use "size" for two different concepts. Maybe "initaliSize" should be "initialCapacity"?