@Test public void bind_Should_CallBindOnEachViewBinder(){ targetViewBinder.bind(viewHolder, viewFinder, target); verify(viewBinderOne).bind(same(viewHolder), same(viewFinder), same(target)); verify(viewBinderTwo).bind(same(viewHolder), same(viewFinder), same(target)); }
public void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target) { for (ViewBinder<Target, ?, ?, ViewHolder> viewBinder : viewBinders) { viewBinder.bind(viewHolder, viewFinder, target); } }
TargetViewBinder { public void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target) { for (ViewBinder<Target, ?, ?, ViewHolder> viewBinder : viewBinders) { viewBinder.bind(viewHolder, viewFinder, target); } } }
TargetViewBinder { public void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target) { for (ViewBinder<Target, ?, ?, ViewHolder> viewBinder : viewBinders) { viewBinder.bind(viewHolder, viewFinder, target); } } TargetViewBinder(List<ViewBinder<Target, ?, ?, ViewHolder>> viewBinders); }
TargetViewBinder { public void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target) { for (ViewBinder<Target, ?, ?, ViewHolder> viewBinder : viewBinders) { viewBinder.bind(viewHolder, viewFinder, target); } } TargetViewBinder(List<ViewBinder<Target, ?, ?, ViewHolder>> viewBinders); void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target); abstract String describeTarget(Target target); final List<ViewBinder<Target, ?, ?, ViewHolder>> getViewBinders(); }
TargetViewBinder { public void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target) { for (ViewBinder<Target, ?, ?, ViewHolder> viewBinder : viewBinders) { viewBinder.bind(viewHolder, viewFinder, target); } } TargetViewBinder(List<ViewBinder<Target, ?, ?, ViewHolder>> viewBinders); void bind(ViewHolder viewHolder, ViewFinder viewFinder, Target target); abstract String describeTarget(Target target); final List<ViewBinder<Target, ?, ?, ViewHolder>> getViewBinders();  }