Exception in thread \"main\" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604)
lstpp is empty. You cant access the first element of an empty list.
lstpp
In general, you can check if size > index.
size > index
In your case, you need to check if lstpp is empty. (you can use !lstpp.isEmpty())
!lstpp.isEmpty()