The question arose while reading a answer to this question - How do I join two lists in java. This answer gave the solution
List newList = new Arra
In your example it really looks evil and ugly, at least to me - it's difficult to understand what's going on in the code. But there are some patterns of using anonymous classes that people are used to because they see them very often, eg
Arrays.sort(args, new Comparator() {
public int compare(String o1, String o2) {
return ...
}});
I would call the above a best practice case.