@Test
public void testUpdateHosts() throws Exception
{

    LocalPeer localPeer = mock( LocalPeer.class );
    ResourceHost resourceHost = mock( ResourceHost.class );
    doReturn( localPeer ).when( registry ).getLocalPeer();
    doReturn( Sets.newHashSet( resourceHost ) ).when( localPeer ).getResourceHosts();
    registry.updateHosts();
    verify( registry, times( 2 ) ).checkAndUpdateHosts( anySet() );
}