@NonNull
  public List<VFSConnectionDetails> getAllDetails( @NonNull ConnectionManager manager ) {
    return getProviders( manager )
      .stream()
      .flatMap( provider -> {
        List<VFSConnectionDetails> providerDetails = provider.getConnectionDetails( manager );
        return providerDetails != null ? providerDetails.stream() : null;
      } )
      .collect( Collectors.toList() );
  }
@Test
  public void testGetAllDetailsReturnsAllDetailsFromAllVFSProvidersFromManager() {
    ConnectionProvider<? extends ConnectionDetails> provider1 =
      (ConnectionProvider<? extends ConnectionDetails>) mock( VFSConnectionProvider.class );
    ConnectionProvider<? extends ConnectionDetails> provider2 =
      (ConnectionProvider<? extends ConnectionDetails>) mock( VFSConnectionProvider.class );
    ConnectionProvider<? extends ConnectionDetails> provider3 =
      (ConnectionProvider<? extends ConnectionDetails>) mock( VFSConnectionProvider.class );

    doReturn( Arrays.asList( provider1, provider2, provider3 ) )
      .when( connectionManager )
      .getProvidersByType( VFSConnectionProvider.class );

    VFSConnectionDetails details1 = mock( VFSConnectionDetails.class );
    VFSConnectionDetails details2 = mock( VFSConnectionDetails.class );
    VFSConnectionDetails details3 = mock( VFSConnectionDetails.class );
    VFSConnectionDetails details4 = mock( VFSConnectionDetails.class );

    doReturn( Arrays.asList( details3, details4 ) ).when( provider1 ).getConnectionDetails( connectionManager );
    doReturn( null ).when( provider2 ).getConnectionDetails( connectionManager );
    doReturn( Arrays.asList( details1, details2 ) ).when( provider3 ).getConnectionDetails( connectionManager );

    List<VFSConnectionDetails> allDetails = vfsConnectionManagerHelper.getAllDetails( connectionManager );

    assertNotNull( allDetails );
    assertEquals( 4, allDetails.size() );
    assertSame( details3, allDetails.get( 0 ) );
    assertSame( details4, allDetails.get( 1 ) );
    assertSame( details1, allDetails.get( 2 ) );
    assertSame( details2, allDetails.get( 3 ) );
  }