Using LinkedList instead of ArrayList.

//List<String>friendList=new ArrayList<String>();
List<String>friendList=new LinkedList<String>();