### Question:
DefaultStorIOContentResolver extends StorIOContentResolver { @NonNull public static Builder builder() { return new Builder(); } protected  DefaultStorIOContentResolver(@NonNull ContentResolver contentResolver,
                                           @NonNull Handler contentObserverHandler,
                                           @NonNull TypeMappingFinder typeMappingFinder,
                                           @Nullable Scheduler defaultRxScheduler,
                                           @NonNull List<Interceptor> interceptors); @SuppressWarnings("ConstantConditions") @NonNull @Override Flowable<Changes> observeChangesOfUris(@NonNull final Set<Uri> uris, @NonNull BackpressureStrategy backpressureStrategy); @Override Scheduler defaultRxScheduler(); @NonNull @Override LowLevel lowLevel(); @NonNull @Override List<Interceptor> interceptors(); @NonNull static Builder builder();  }### Answer:
@Test public void nullContentResolver() { DefaultStorIOContentResolver.Builder builder = DefaultStorIOContentResolver.builder(); expectedException.expect(NullPointerException.class); expectedException.expectMessage("Please specify content resolver"); expectedException.expectCause(nullValue(Throwable.class)); builder.contentResolver(null); }
@Test public void addTypeMappingNullType() { DefaultStorIOContentResolver.CompleteBuilder builder = DefaultStorIOContentResolver.builder() .contentResolver(mock(ContentResolver.class)); expectedException.expect(NullPointerException.class); expectedException.expectMessage("Please specify type"); expectedException.expectCause(nullValue(Throwable.class)); builder.addTypeMapping(null, ContentResolverTypeMapping.builder() .putResolver(mock(PutResolver.class)) .getResolver(mock(GetResolver.class)) .deleteResolver(mock(DeleteResolver.class)) .build()); }
@Test public void addTypeMappingNullMapping() { DefaultStorIOContentResolver.CompleteBuilder builder = DefaultStorIOContentResolver.builder() .contentResolver(mock(ContentResolver.class)); expectedException.expect(NullPointerException.class); expectedException.expectMessage("Please specify type mapping"); expectedException.expectCause(nullValue(Throwable.class)); builder.addTypeMapping(Object.class, null); }
@Test public void nullTypeMappingFinder() { DefaultStorIOContentResolver.CompleteBuilder builder = DefaultStorIOContentResolver.builder() .contentResolver(mock(ContentResolver.class)); expectedException.expect(NullPointerException.class); expectedException.expectMessage("Please specify typeMappingFinder"); expectedException.expectCause(nullValue(Throwable.class)); builder.typeMappingFinder(null); }
@Test public void shouldUseSpecifiedTypeMappingFinder() throws NoSuchFieldException, IllegalAccessException { TypeMappingFinder typeMappingFinder = mock(TypeMappingFinder.class); DefaultStorIOContentResolver storIOContentResolver = DefaultStorIOContentResolver.builder() .contentResolver(mock(ContentResolver.class)) .typeMappingFinder(typeMappingFinder) .build(); assertThat(getTypeMappingFinder(storIOContentResolver)).isEqualTo(typeMappingFinder); }