S3TimeOrderPrefixFileExplorer extends S3PrefixFileExplorer { @Override public boolean hasNext() { if (lastPath == null) { LOGGER.info("The total number of LIST requests is {}{}.", numOfReq, numOfReq < 10 ? "" : ". Clean up your s3 bucket to reduce the number of requests and improve the ingesting performance"); return false; } return true; } S3TimeOrderPrefixFileExplorer(final String bucket, final AmazonS3 client, final RetryExecutor retryExecutor,
            final String pathPrefix, final boolean skipGlacierObjects, final Optional<Date> from, final Date to); @Override List<S3ObjectSummary> fetch(); @Override boolean hasNext();  }
@Test public void hasNext_should_return_false_if_no_lastpath() throws NoSuchFieldException { new FieldSetter(s3TimeOrderPrefixFileExplorer, s3TimeOrderPrefixFileExplorer.getClass().getDeclaredField("lastPath")).set(null); assertFalse(s3TimeOrderPrefixFileExplorer.hasNext()); }