### Question:
NavigationIconResolver { public void resolve(Button button, Integer direction, Func1<Drawable> onSuccess) { if (button.icon.hasValue()) { imageLoader.loadIcon(context, button.icon.get(), new ImageLoadingListenerAdapter() { @Override public void onComplete(@NonNull Drawable icon) { onSuccess.run(icon); } @Override public void onError(Throwable error) { throw new RuntimeException(error); } }); } else if (Constants.BACK_BUTTON_ID.equals(button.id)) { Boolean isRTL = direction == View.LAYOUT_DIRECTION_RTL; onSuccess.run(ContextCompat.getDrawable(context, isRTL ? R.drawable.ic_arrow_back_black_rtl_24dp : R.drawable.ic_arrow_back_black_24dp)); } else { Log.w("RNN", "Left button needs to have an icon"); } } NavigationIconResolver(Context context, ImageLoader imageLoader); void resolve(Button button, Integer direction, Func1<Drawable> onSuccess);  }### Answer:
@Test public void create_iconButton() { @SuppressWarnings("Convert2Lambda") Func1<Drawable> onSuccess = spy(new Func1<Drawable>() { @Override public void run(Drawable icon) { } }); uut.resolve(iconButton(), View.LAYOUT_DIRECTION_LTR, onSuccess); verify(imageLoader).loadIcon(eq(context), eq(ICON_URI), any()); verify(onSuccess).run(any(Drawable.class)); }
@Test public void create_backButton() { @SuppressWarnings("Convert2Lambda") Func1<Drawable> onSuccess = spy(new Func1<Drawable>() { @Override public void run(Drawable param) { } }); uut.resolve(backButton(), View.LAYOUT_DIRECTION_LTR, onSuccess); verifyZeroInteractions(imageLoader); verify(onSuccess).run(any()); }