### Question:
EasyAdapterUtil { public static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) { try { Constructor<? extends ItemViewHolder> constructor = itemViewHolderClass.getConstructor(View.class); return constructor.newInstance(view); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException("Unable to find a public constructor that takes an argument View in " + itemViewHolderClass.getSimpleName(), e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getTargetException()); } catch (InstantiationException e) { throw new RuntimeException("Unable to instantiate " + itemViewHolderClass.getSimpleName(), e); } }  static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass); static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass);  }### Answer:
@Test public void testCreateViewHolder() throws Exception { View view = new View(RuntimeEnvironment.application); ItemViewHolder<?> itemViewHolder = EasyAdapterUtil.createViewHolder(view, ValidItemViewHolder.class); Assert.assertNotNull(itemViewHolder); }
@Test public void testCreateInvalidViewHolder() throws Exception { View view = new View(RuntimeEnvironment.application); RuntimeException exception = null; try { EasyAdapterUtil.createViewHolder(view, InvalidItemViewHolder.class); } catch (RuntimeException e) { exception = e; } Assert.assertNotNull(exception); }