Open orionll opened 11 years ago
The problem is that the vararg takes an array of T, where it should just an array of Object. For tests it really doesn't matter type safety in the vararg. A failing test will tell the user that something is wrong.
Wouldn't adding a @SafeVarargs
annotation suffice?
This problem can be solved by overloading a varargs method with a different number of arguments:
This technique is used, for example, in Guava: http://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/collect/ImmutableList.java