Avoid unnecessary condition on numberOfElements. Add a few tests for shift methods