public Optional<UpdateCenter> getUpdateCenter(boolean refreshUpdateCenter) {
    Optional<UpdateCenter> updateCenter = centerClient.getUpdateCenter(refreshUpdateCenter);
    if (updateCenter.isPresent()) {
      org.sonar.api.utils.Version fullVersion = sonarQubeVersion.get();
      org.sonar.api.utils.Version semanticVersion = org.sonar.api.utils.Version.create(fullVersion.major(), fullVersion.minor(), fullVersion.patch());

      return Optional.of(updateCenter.get().setInstalledSonarVersion(Version.create(semanticVersion.toString())).registerInstalledPlugins(
        installedPluginReferentialFactory.getInstalledPluginReferential())
        .setDate(centerClient.getLastRefreshDate()));
    }
    return Optional.empty();
  }
@Test
  public void return_absent_update_center() {
    UpdateCenterClient updateCenterClient = mock(UpdateCenterClient.class);
    when(updateCenterClient.getUpdateCenter(anyBoolean())).thenReturn(Optional.empty());

    underTest = new UpdateCenterMatrixFactory(updateCenterClient, mock(SonarQubeVersion.class), mock(InstalledPluginReferentialFactory.class));

    Optional<UpdateCenter> updateCenter = underTest.getUpdateCenter(false);

    assertThat(updateCenter).isEmpty();
  }