### Question:
FromClassViewAttributeFactories { static <T extends Object> T newViewAttribute(Class<T> viewAttributeClass) { try { return viewAttributeClass.newInstance(); } catch (InstantiationException e) { throw new RuntimeException("View Attribute class " + viewAttributeClass.getName() + " could not be instantiated: " + e); } catch (IllegalAccessException e) { throw new RuntimeException("View Attribute class " + viewAttributeClass.getName() + " is not public"); } } private  FromClassViewAttributeFactories(); static OneWayPropertyViewAttributeFactory<ViewType> oneWayPropertyViewAttributeFactoryForClass(
			final Class<? extends OneWayPropertyViewAttribute<ViewType, ?>> propertyViewAttributeClass); static TwoWayPropertyViewAttributeFactory<ViewType> twoWayPropertyViewAttributeFactoryForClass(
			final Class<? extends TwoWayPropertyViewAttribute<ViewType, ?, ?>> propertyViewAttributeClass); static OneWayMultiTypePropertyViewAttributeFactory<ViewType> oneWayMultiTypePropertyViewAttributeFactoryForClass(
			final Class<? extends OneWayMultiTypePropertyViewAttribute<ViewType>> multiTypePropertyViewAttributeClass); static TwoWayMultiTypePropertyViewAttributeFactory<ViewType> twoWayMultiTypePropertyViewAttributeFactoryForClass(
			final Class<? extends TwoWayMultiTypePropertyViewAttribute<ViewType>> multiTypePropertyViewAttributeClass); static EventViewAttributeFactory<ViewType> eventViewAttributeFactoryForClass(
			final Class<? extends EventViewAttribute<ViewType, ? extends ViewAddOn>> eventViewAttributeClass); static GroupedViewAttributeFactory<ViewType> groupedViewAttributeFactoryForClass(
			final Class<? extends GroupedViewAttribute<ViewType>> groupedViewAttributeClass);  }### Answer:
@Test public void shouldCreateNewInstanceFromClass() { ViewAttributeBinder viewAttributeBinder = FromClassViewAttributeFactories.newViewAttribute(ViewAttributeBinderImpl.class); assertNotNull(viewAttributeBinder); }
@Test(expected = RuntimeException.class) public void givenSuppliedClassIsAbstract_shouldThrowRuntimeException() { FromClassViewAttributeFactories.newViewAttribute(AbstractViewAttribute.class); }
@Test(expected = RuntimeException.class) public void givenSuppliedClassIsNotVisible_shouldThrowRuntimeException() { FromClassViewAttributeFactories.newViewAttribute(NonVisibleViewAttribute.class); }