added last and last with predicate along with tests.