Java Tips: Initializing Collection

Especially in unit test, it is common case that we have to initialize an array or a collection. Well, for array, it’s OK… A simple code that we know can solve the problem: But how about Collection? Normal way to initialize collection is something like this (which pretty ugly): I hardly find an elegant solution …