I have the below function:
public void putList(String key, List lst){ if (T instanceof String) { // Do something
You can not find the type of T as the type information is erased. Check this for more details. But if the list is not empty, you can get an element from the list and can find out using instanceof and if else
T
instanceof
if else