MultipartUtils { public static boolean shouldCalculateMd5( @NonNull UploadConfiguration config, @NonNull PutObjectRequest request) { return config.isEnforceMd5BeforeUpload() && request.getContentMD5() == null; }  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 shouldCalculateMd5_disabled() { assertFalse( MultipartUtils.shouldCalculateMd5( UploadConfiguration.builder().enforceMd5(false).build(), PutObjectRequest.builder().build())); }
@Test public void shouldCalculateMd5_enabled_alreadySet() { assertFalse( MultipartUtils.shouldCalculateMd5( UploadConfiguration.builder().enforceMd5(true).build(), PutObjectRequest.builder().contentMD5("md5").build())); }
@Test public void shouldCalculateMd5_enabled_notSet() { assertTrue( MultipartUtils.shouldCalculateMd5( UploadConfiguration.builder().enforceMd5(true).build(), PutObjectRequest.builder().build())); }