I am stuck on an issue. I am trying to sort via alphabetical order, I pasting my code snippet below and issue.
String arr = new String;
arr = config.getfoldersdata() + "." + config.getCars();
arr = config.getType();
arr = entry.getVals() ? "Data" : "Entry";
Your design is awful: the arrays should in fact be objects.
But anyway, you just need a comparator which sorts the array based on their first element's natural ordering:
result.sort(Comparator.comparing(array -> array));