LPS-32223 Autosuggest not showing the tags defined for the Global content in asset publisher
LPS-32223 - Remove the logic which tries to fix the passed groupIds

The backend will be in charge to provide correct groupIds

Signed-off-by: Zsolt Szabo <zsolt.szabo@liferay.com>
LPS-29501 move logic to backend
LPS-32223 layouts can not have tags
LPS-32223 support for searching tags in multiple groupIds
LPS-32223 autogenerated
LPS-32223 Optimize ArrayUtil vs ArrayList usage. In this case, the majority of the time, you will have an array of size 1. Therefore, by doing it this way, you avoid creating a new list, to add to it, to convert it back to an array. In the cases where you have to append to an array of length 2, it still cost you just 2 arrays, vs 1 array list (backed by an array of a much larger size since it doesn't know its ultimate size) plus another converted array - so you save one array list and use 2 smaller arrays.
LPS-32223 This is very different from the previous commit. Now, we're optimizing for readability and "correct behavior". Prior to these changes, I don't think this code actually works.

The first line was: long[] categorizableGroupIds = new long[groupIds.length];

That creates an array of categorizableGroupIds, but, it's just empty with a bunch of 0s. So if the number of groupIds is 5. You have an array of {0, 0, 0, 0, 0}

Then, you check if that array has the group ID, and if it doesn't , you append. So you end up with

{0, 0, 0, 0, 0, 538}  where 538 is the next group ID. I don't think that was the intended logic.

My new changes ensures that there are no duplicate group IDs. But, it costs me a HashSet and the conversion from as HashSet to a Long[] to a long[]. I'm willing to pay this price because the ArrayUtil.contains is an iteration anyways, compared to the HashSet.contains. So it's about the same price I think...

Anyways, the other logic was wrong, so it needed to be fixed.
LPS-32485
LPS-32223 LPS-32485 Save some cycles