I\'m trying to find a way to iterate through an enum\'s values while using generics. Not sure how to do this or if it is possible.
The following code illustrates
The root problem is that you need to convert an array to a list, right? You can do this, by using a specific type (TimePeriod instead of T), and the following code.
So use something like this:
List list = new ArrayList();
list.addAll(Arrays.asList(sizes));
Now you can pass list into any method that wants a list.