### Question:
ModelFactory { @SuppressWarnings("unchecked") public static void setModelClass(Class<?> modelClass) throws IllegalArgumentException { if (!DefaultModelImpl.class.isAssignableFrom(modelClass)) { throw new IllegalArgumentException("Modelclass, " + modelClass.getName() + ", is not a subtype of " + DefaultModelImpl.class.getName()); } ModelFactory.modelClass = (Class<DefaultModelImpl>)modelClass; } private  ModelFactory(); @SuppressWarnings("unchecked") static void setModelClass(Class<?> modelClass); @SuppressWarnings("rawtypes") static void setModelGroovyClass(URL url); static void resetModelClass(); static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, TransportEnum inboundTransport, TransportEnum outboundTransport, TransformerEnum transformerType); static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, DeploymentModelEnum deploymentModel, List<TransportEnum> transports); static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, List<TransportEnum> transports, String serviceDescriptor, List<String> operations);  }### Answer:
@Test public void testCustomModelImpl_error() throws InstantiationException, IllegalAccessException { try { ModelFactory.setModelClass(String.class); fail("Expected IllegalArgumentException to be throwed"); } catch (IllegalArgumentException e) { } }