Added "getFirstElem" method and test for it.