I would change the ground truth to a String[], and modify this helper function to take a String[]... so that you can avoid the | delimiter and assembling the String back together.