We have Collections.EMPTY_LIST but it is not typed, which shows an eclipse warning. How do I set an empty list of a certain type.
Advertisement
Answer
Try this
Collections.<String> emptyList();
See this also Type-safe, generic, empty Collections with static generics