I have a method which tests if a List of Double contains some String elements. This list is populated with Spring. I do not know how I can populate it with String in a JUnit.
My method converts String to Double with the following code:
// [...]
Obect element = list.get(i); // list is my List<Double>
if(element.getClass() == String.class) {
list.set(i, Double.parseDouble((String) element));
}