Programming a Java Snippet node

Premising that I’m not expert of JAVA programming, I tired to use KNIME AI Assistant and with his suggestion I write the below code in order to do the following operations on a dataset composed by two columns:

  • sorting the dataset according column Count(ID) (descending value);

  • truncate the data set according the following criteria: cumulative sum of Count(ID)/Sum of all Count(ID) elements >=0,8.

I don’t fully understand why this code doesn’t work.