@Test
public void testGetAllServicesForInstance() {

    GenericQueryResults.Builder<ServiceInfoBo> resultBuilder = GenericQueryResults.Builder.<ServiceInfoBo>create();
    for (int i = 0; i < 5; i++) {
        resultBuilder.getResults().add(createServiceInfo("service" + i));
    }
    when(dataObjectService.findMatching(eq(ServiceInfoBo.class), any(QueryByCriteria.class))).thenReturn(resultBuilder.build());
    List<ServiceInfo> serviceInfos = serviceRegistry.getAllServicesForInstance("MyInstance");
    assertEquals(5, serviceInfos.size());
}