MultipartUtils { public static boolean shouldUseMultipart( @NonNull UploadConfiguration config, long contentLength) { return config.isAllowMultipartUploads() && meetsMinimumSize(config, contentLength); }  static boolean shouldUseMultipart(
            @NonNull UploadConfiguration config, long contentLength); static long calculatePartSize(@NonNull UploadConfiguration config, long contentLength); static boolean shouldCalculateMd5(
            @NonNull UploadConfiguration config, @NonNull PutObjectRequest request); @VisibleForTesting static final long MiB; }
@Test public void shouldUseMultipart() { UploadConfiguration configuration = UploadConfiguration.builder().build(); assertTrue(MultipartUtils.shouldUseMultipart(configuration, LARGE_ENOUGH_FOR_MULTIPART)); }
@Test public void shouldUseMultipart_multipartsDisabled_shouldReturnFalse() { UploadConfiguration configuration = UploadConfiguration.builder().allowMultipartUploads(false).build(); assertFalse(MultipartUtils.shouldUseMultipart(configuration, LARGE_ENOUGH_FOR_MULTIPART)); }
@Test public void shouldUseMultipart_objectNotLargeEnough_shouldReturnFalse() { UploadConfiguration configuration = UploadConfiguration.builder().build(); assertFalse( MultipartUtils.shouldUseMultipart(configuration, LARGE_ENOUGH_FOR_MULTIPART - 1L)); }
@Test public void shouldUseMultipart_objectTooLarge_shouldReturnTrue() { UploadConfiguration configuration = UploadConfiguration.builder().build(); assertTrue(MultipartUtils.shouldUseMultipart(configuration, TOO_LARGE_FOR_MULTIPART)); }
@Test public void shouldUseMultipart_objectNotTooLarge_shouldReturnTrue() { UploadConfiguration configuration = UploadConfiguration.builder().build(); assertTrue(MultipartUtils.shouldUseMultipart(configuration, TOO_LARGE_FOR_MULTIPART - 1L)); }