public void testCallsAreDispatchedBetweenObjects() throws Exception {
Mock fooMock = mock(Foo.class);
Mock barMock = mock(Bar.class);
Object foobar = Dispatching.object(new Class[]{Foo.class, Bar.class}, new Object[]{
fooMock.proxy(), barMock.proxy()}, getFactory());
fooMock.expects(once()).method("getSomething").withNoArguments().will(returnValue("some thing"));
barMock.expects(once()).method("doSomething").with(eq("some thing"));
assertEquals("some thing", ((Foo)foobar).getSomething());