The assignment requires to write code in java for an Operating System scheduling algorithm

The method to be used is Shortest Remaining Time First (SRTF) this is the preemptive version of Shortest Job First (SJF).

i have already tried most of the codes given online and they do work but they all have some problems in the implementation of the algorithm wihch gives the wrong output. I am attaching some input files and expected output files which you can use as test cases.