@Test
public void testRestrictedMethodNames() throws Exception {

	RestrictedLiferayObjectWrapper restrictedLiferayObjectWrapper =
		new RestrictedLiferayObjectWrapper(
			null, null,
			new String[] {
				TestLiferayMethodObject.class.getName() + "#getName"
			});
	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");
	SimpleMethodModel simpleMethodModel =
		(SimpleMethodModel)liferayFreeMarkerStringModel.get("generate");
	TemplateModel resultTemplateModel =
		(TemplateModel)simpleMethodModel.exec(
			Collections.singletonList(new SimpleScalar("generate")));
	Assert.assertEquals("test-generate", resultTemplateModel.toString());
}