public String[] getS3ObjectsNames( String bucketName ) throws Exception {
    Bucket bucket = getBucket( bucketName );
    if ( bucket == null ) {
      throw new Exception( Messages.getString( "S3DefaultService.Exception.UnableToFindBucket.Message", bucketName ) );
    }
    return getS3Objects( bucket ).getObjectSummaries().stream().map( b -> b.getKey() ).toArray( String[]::new );
  }
@Test public void testGetObjectsNamesInBucketWithObjects() throws Exception {
    List<String> actual = Arrays.asList( provider.getS3ObjectsNames( BUCKET2_NAME ) );
    assertEquals( bucket2Objects.getObjectSummaries().size(), actual.size() );
    List<S3ObjectSummary> expectedList = bucket2Objects.getObjectSummaries();
    expectedList.stream().forEach( i -> assertTrue( actual.contains( i.getKey() ) ) );
  }