@Override
    public List<ResourceGroupRuntimeInfo> getResourceGroupInfo()
            throws ResourceManagerInconsistentException
    {
        InternalNode currentNode = internalNodeManager.getCurrentNode();
        return cache.apply(currentNode);
    }
@Test
    public void testGetResourceGroupInfo()
            throws Exception
    {
        TestingResourceManagerClient resourceManagerClient = new TestingResourceManagerClient();
        InMemoryNodeManager nodeManager = new InMemoryNodeManager();
        ResourceManagerConfig resourceManagerConfig = new ResourceManagerConfig();
        ResourceManagerResourceGroupService service = new ResourceManagerResourceGroupService((addressSelectionContext, headers) -> resourceManagerClient, resourceManagerConfig, nodeManager);
        List<ResourceGroupRuntimeInfo> resourceGroupInfos = service.getResourceGroupInfo();
        assertNotNull(resourceGroupInfos);
        assertTrue(resourceGroupInfos.isEmpty());
        assertEquals(resourceManagerClient.getResourceGroupInfoCalls("local"), 1);

        resourceManagerClient.setResourceGroupRuntimeInfos(ImmutableList.of(new ResourceGroupRuntimeInfo(new ResourceGroupId("global"), 1, 2, 3, 0, 1, Optional.empty())));

        Thread.sleep(SECONDS.toMillis(2));

        resourceGroupInfos = service.getResourceGroupInfo();
        assertNotNull(resourceGroupInfos);
        assertEquals(resourceGroupInfos.size(), 1);
        assertEquals(resourceManagerClient.getResourceGroupInfoCalls("local"), 2);
    }