Added "getLastElem2" method and test for it.