@Test
public void testRestrictedClass() throws Exception {

	RestrictedLiferayObjectWrapper restrictedLiferayObjectWrapper =
		new RestrictedLiferayObjectWrapper(
			null, new String[] {TestLiferayMethodObject.class.getName()},
			null);
	TemplateModel templateModel = restrictedLiferayObjectWrapper.wrap(
		new TestLiferayMethodObject("test"));
	Assert.assertThat(
		templateModel,
		CoreMatchers.instanceOf(LiferayFreeMarkerStringModel.class));
	LiferayFreeMarkerStringModel liferayFreeMarkerStringModel =
		(LiferayFreeMarkerStringModel)templateModel;
	_testRestrictedMethodNames(liferayFreeMarkerStringModel, "name");
	_testRestrictedMethodNames(liferayFreeMarkerStringModel, "Name");
	_testRestrictedMethodNames(liferayFreeMarkerStringModel, "getName");
	_testRestrictedMethodNames(liferayFreeMarkerStringModel, "getname");
	_testRestrictedMethodNames(
		liferayFreeMarkerStringModel, "generateName");
}