I have a String list:
List<String> listString = new ArrayList<String>();
listString.add("faq");
listString.add("general");
listString.add("contact");
I do some processing on the list and I want to sort this list but I want “general” to always end up in first position.
Thx 😉
I like @Petar’s approach, but another approach would be to sort it using a custom Comparator that always said that “general” was before whatever it was being compared to.