@Test
public void testHandleMetadataVersionsListShouldReturnNullIfInstanceDoesNotHaveAnyVersions() throws Exception
{

    AvailabilityStatus availabilityStatus = new AvailabilityStatus( true, "test_message", null );
    when( synchronizationManager.isRemoteServerAvailable() ).thenReturn( availabilityStatus );
    MetadataRetryContext mockRetryContext = mock( MetadataRetryContext.class );
    MetadataVersion currentVersion = new MetadataVersion();
    currentVersion.setType( VersionType.BEST_EFFORT );
    currentVersion.setName( "test_version" );
    currentVersion.setCreated( new Date() );
    currentVersion.setHashCode( "samplehashcode" );
    when( metadataVersionDelegate.getMetaDataDifference( currentVersion ) ).thenReturn( new ArrayList<MetadataVersion>() );
    List<MetadataVersion> expectedListOfVersions = metadataSyncPreProcessor.handleMetadataVersionsList( mockRetryContext, currentVersion );
    assertTrue( expectedListOfVersions.size() == 0 );
}