If there are any realtionships between SublistLocalData class and the Localdata class you can create a class that is a super class both of them or an Interface which the two classes implements.
Say you have this class : class AbstractSuperClass {}
Then : Here how to declare a list of the superClass : List list;
Using this list, you can add any type of AbstractSuperClass (classes that inherits from it like SublistLocalData and Localdata )
You can then write :
list.add(new SublistLocalData());
orlist.add(new Localdata());