for (String name : allRefs.keySet()) {
when(mockRefDb.getRef(eq(name))).thenReturn(allRefs.get(name));
}
Context mockCommandLocator = mock(Context.class);
when(mockCommandLocator.refDatabase()).thenReturn(mockRefDb);
command.setContext(mockCommandLocator);
ResolveObjectType mockResolveObjectType = mock(ResolveObjectType.class);
when(mockCommandLocator.command(eq(ResolveObjectType.class))).thenReturn(
mockResolveObjectType);