I was testing some of my methods for my class and I got the following error:
java.lang.AssertionError: expected: com.company.ArrayList<[ 11 12 ]> but was: com.company.ArrayList<[ 11 12 ]>
I fail to see the difference. Basically what I have is this test:
public void setUp() throws Exception {
List ot = new ArrayList();
ot.add(11);
ot.add(12);
prg = new ProgState(ot);
}
prg was declared before in the class, as private.
@Test
public void testGetOut() throws Exception {
List wtf = new ArrayList();
wtf.add(11);
wtf.add(12);
assertEquals(wtf, prg.getOut());
}
ArrayList is my own ADT, List is interface, ProgState is just:
public class ProgState {
private List out;
public ProgState(List ot) {
out = ot;
}
public List getOut() {
return out;
}
It's just returning my list. Why won't it accept ot = [11, 12] being the same as wtf = [11, 12]? I have no idea at all.