swappable data structure for arraylist, linkedlist, set and hashmap