HM Revenue and Customs interview question

reverse a list using java. explain the complexity. write tests