@Test(expected = ViewHolderNotFoundException.class) public void createViewHolder_When_ViewHolderClassDoesExists(){ Object test = new Object(); new ViewHolderFactory().createViewHolder(test).getClass(); }
Object createViewHolder(Object target) { try { Class clazz = ClassUtils.findViewHolder(target); return clazz.newInstance(); } catch (Exception e) { throw new ViewHolderNotFoundException("Could not find view holder for " + target.getClass().getName()); } }
ViewHolderFactory { Object createViewHolder(Object target) { try { Class clazz = ClassUtils.findViewHolder(target); return clazz.newInstance(); } catch (Exception e) { throw new ViewHolderNotFoundException("Could not find view holder for " + target.getClass().getName()); } } }
ViewHolderFactory { Object createViewHolder(Object target) { try { Class clazz = ClassUtils.findViewHolder(target); return clazz.newInstance(); } catch (Exception e) { throw new ViewHolderNotFoundException("Could not find view holder for " + target.getClass().getName()); } }  }
ViewHolderFactory { Object createViewHolder(Object target) { try { Class clazz = ClassUtils.findViewHolder(target); return clazz.newInstance(); } catch (Exception e) { throw new ViewHolderNotFoundException("Could not find view holder for " + target.getClass().getName()); } }   }
ViewHolderFactory { Object createViewHolder(Object target) { try { Class clazz = ClassUtils.findViewHolder(target); return clazz.newInstance(); } catch (Exception e) { throw new ViewHolderNotFoundException("Could not find view holder for " + target.getClass().getName()); } }    }