I'm using Java as a sample. Let's say I'm developing a software and I have this
CustomList extends ArrayList<ObjectMapper>
Now this has custom functions added to ArrayList. It's designed specifically to cater to Lists of ObjectMapper instances (maybe JsonNode, TreeNode; belongs to jackson dependency). Now the entire project utilizes this. But someone mentioned this: "What if ArrayList gets deprecated or obsolete in the future?" If that does happen, we'd have to rewrite or modify the entire source code. So they called this Bad Design. How can I avoid this? Should I create an interface OurList that implements List and have it implemented as OurArrayList which will be what we will be utilizing? Please explain how it can be properly done. Say I want to be able to use ArrayList's iterate method. What's the best way to do so without compromising the project code maintainability?