You should either have a generic class or a generic method like below:
public class Test {
List list = new ArrayList();
public Test(){
}
public void populate(T t){
list.add(t);
}
public static void main(String[] args) {
new Test().populate("abc");
}
}