### Question:
SimpleObjects { @Action(semantics = SemanticsOf.SAFE) @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT) @MemberOrder(sequence = "1") public List<SimpleObject> listAll() { return container.allInstances(SimpleObject.class); }  TranslatableString title(); @Action(semantics = SemanticsOf.SAFE) @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT) @MemberOrder(sequence = "1") List<SimpleObject> listAll(); @Action(semantics = SemanticsOf.SAFE) @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT) @MemberOrder(sequence = "2") List<SimpleObject> findByName(@ParameterLayout(named = "Name") final String name); @Action(domainEvent = CreateDomainEvent.class) @MemberOrder(sequence = "3") SimpleObject create(@ParameterLayout(named = "Name") final String name);  }### Answer:
@Test public void testListAll() throws Exception { final List<SimpleObject> all = Lists.newArrayList(); context.checking(new Expectations() { { oneOf(mockContainer).allInstances(SimpleObject.class); will(returnValue(all)); } }); final List<SimpleObject> list = simpleObjects.listAll(); assertEquals(all, list); }
@Test public void testListAll() { final List<SimpleObject> all = Lists.newArrayList(); context.checking(new Expectations() { { oneOf(mockContainer).allInstances(SimpleObject.class); will(returnValue(all)); } }); final List<SimpleObject> list = simpleObjects.listAll(); assertEquals(all, list); }