SnackbarBuilder { @SuppressWarnings("WeakerAccess") public SnackbarBuilder iconMarginRes(@DimenRes int iconMarginResId) { return iconMargin( context.getResources().getDimensionPixelSize(iconMarginResId)); } SnackbarBuilder(View view);  SnackbarBuilder(Activity activity);  SnackbarBuilder(Activity activity, SnackbarParentFinder parentFinder); SnackbarBuilder message(CharSequence message); @SuppressWarnings("WeakerAccess") SnackbarBuilder message(@StringRes int messageResId); SnackbarBuilder messageTextColor(@ColorInt int messageTextColor); SnackbarBuilder messageTextColorRes(@ColorRes int messageTextColor); @SuppressWarnings("WeakerAccess") SnackbarBuilder appendMessage(CharSequence message); @SuppressWarnings("WeakerAccess") SnackbarBuilder appendMessage(@StringRes int messageResId); SnackbarBuilder appendMessage(CharSequence message, @ColorInt int color); @SuppressWarnings("WeakerAccess") SnackbarBuilder appendMessage(@StringRes int messageResId,
                                       @ColorRes int colorResId); SnackbarBuilder duration(int duration); SnackbarBuilder actionText(CharSequence actionText); @SuppressWarnings("WeakerAccess") SnackbarBuilder actionText(@StringRes int actionTextResId); SnackbarBuilder actionTextColor(@ColorInt int actionTextColor); SnackbarBuilder actionTextColorRes(@ColorRes int actionTextColorResId); SnackbarBuilder actionClickListener(OnClickListener actionClickListener); @SuppressWarnings("WeakerAccess") SnackbarBuilder backgroundColor(@ColorInt int backgroundColor); @SuppressWarnings("WeakerAccess") SnackbarBuilder backgroundColorRes(@ColorRes int backgroundColorResId); SnackbarBuilder callback(Snackbar.Callback callback); SnackbarBuilder snackbarCallback(SnackbarCallback snackbarCallback); @SuppressWarnings("WeakerAccess") SnackbarBuilder showCallback(final SnackbarShowCallback callback); @SuppressWarnings("WeakerAccess") SnackbarBuilder dismissCallback(final SnackbarDismissCallback callback); @SuppressWarnings("WeakerAccess") SnackbarBuilder actionDismissCallback(final SnackbarActionDismissCallback callback); @SuppressWarnings("WeakerAccess") SnackbarBuilder swipeDismissCallback(final SnackbarSwipeDismissCallback callback); SnackbarBuilder timeoutDismissCallback(final SnackbarTimeoutDismissCallback callback); @SuppressWarnings("WeakerAccess") SnackbarBuilder manualDismissCallback(final SnackbarManualDismissCallback callback); @SuppressWarnings("WeakerAccess") SnackbarBuilder consecutiveDismissCallback(final SnackbarConsecutiveDismissCallback callback); SnackbarBuilder actionAllCaps(boolean actionAllCaps); SnackbarBuilder icon(Drawable icon); SnackbarBuilder icon(@DrawableRes int iconResId); @SuppressWarnings("WeakerAccess") SnackbarBuilder iconMargin(int iconMargin); @SuppressWarnings("WeakerAccess") SnackbarBuilder iconMarginRes(@DimenRes int iconMarginResId); SnackbarWrapper buildWrapper(); Snackbar build();  }
@Test public void whenIconMarginRes_thenIconMarinSet() { SnackbarBuilder builder = createBuilder(); int iconMargin = 100; @DimenRes int dimenResId = getResourceCreator(builder) .getDimensionPixelSize(iconMargin); builder.iconMarginRes(dimenResId); assertThat(builder.iconMargin).isEqualTo(iconMargin); }