Following is my class, where Display class has a static method resultDisplay(). Display class is coming from a jar file. I want to write junit for testCode() method. I am not interested in Display.resultdisplay() call. I just want to verify the content of list in junit.
public class Summation {
private static final List<Integer> list = new ArrayList<>();
public int testCode(int... a) {
for(int aa : a)
list.add(aa);
return Display.resultDisplay(list);
}
}