You problably import the wrong class of NdefMessage. You should:
import org.ndeftools.Message;
But I guess you're importing "android.nfc.NdefMessage" which is part of Android and not the NdefTools library.
Old answer:
The problem is at this line:
List <Record> records = new Message((NdefMessage) messages[i]);
You're trying to instantiate one NdefMessage (messages[i]) as a List of Records?