@Test public void variableAtShouldCallResolveObject() { try { PrimObject primObject = new PrimObject(); PrimObjectClass primObjectClass = mock(PrimObjectClass.class); when(primObjectClass.indexOfVariable("Thing")).thenReturn(0); primObject.cls(primObjectClass); PrimObject spy = spy(primObject); spy.variableAt("Thing"); verify(spy).resolveObject("Thing"); } catch (Throwable e) { try { PrintStream f = new PrintStream(new FileOutputStream("c:\\Users\\7\\redline-smalltalk\\x2.txt")); e.printStackTrace(f); } catch (FileNotFoundException h) { throw new RuntimeException(h); } throw new RuntimeException("in variableAtShouldCallResolveObject"); } }