I am new to this RxJava coding language.
I am trying to write a function that recursively copies files from one S3 location and pastes the content to another S3 location.
Here is the code that I have written for this

private Single<CopyObjectResponse> copyObjectsRecursively(String sourceBucketName, String sourceKeyPrefix,String destinationBucketName, String destinationKeyPrefix) {
        return listObjects(sourceKeyPrefix, sourceBucketName)
                .concatMap(listObjectsV2Response -> Observable.fromIterable(listObjectsV2Response.contents())
                        .flatMapSingle(s3Object -> {
                            if (s3Object.key().endsWith("/")) {
                                String newSourceKey = s3Object.key();
                                String newDestinationKey = buildDestinationKey(destinationKeyPrefix, newSourceKey, sourceKeyPrefix);
                                return copyObjectsRecursively(sourceBucketName, newSourceKey, destinationBucketName, newDestinationKey);
                            } else {
                                CopyObjectRequest copyRequest = CopyObjectRequest.builder()
                                        .destinationKey(buildDestinationKey(destinationKeyPrefix, s3Object.key(), sourceKeyPrefix))
                                return Single.fromFuture(buildClient.copyObject(copyRequest));
                .onErrorResumeNext(error -> Single.error(error));

The problem with this code is, this is complaining that

cannot find symbol 
[ERROR]   symbol:   method concatMap((listObjec[...] } })) 
[ERROR]   location: class io.reactivex.Single<software.amazon.awssdk.services.s3.model.ListObjectsV2Response>

I have check that I have correct imports in my code

import io.reactivex.Single; 
import io.reactivex.Completable; 
import io.reactivex.Observable;

But this is still complaining

I tried looking at all the imports in my code, Checked the version of RxJava(2.x.x) but still this is not able to find the concatMap symbol in the code.