### Question:
OpensocialFunctions { @Functions.Expose(prefix = "os", names = {"htmlEncode"}) public static String htmlEncode(String text) { if (text == null) { return null; } return StringEscapeUtils.escapeHtml4(text); } private  OpensocialFunctions(); @Functions.Expose(prefix = "osx", names = {"parseJson"}) static Object parseJson(String text); @Functions.Expose(prefix = "osx", names = {"decodeBase64"}) static String decodeBase64(String text); @Functions.Expose(prefix = "os", names = {"urlEncode"}) static String formEncode(String text); @Functions.Expose(prefix = "os", names = {"urlDecode"}) static String formDecode(String text); @Functions.Expose(prefix = "os", names = {"htmlEncode"}) static String htmlEncode(String text); @Functions.Expose(prefix = "os", names = {"htmlDecode"}) static String htmlDecode(String text);  }### Answer:
@Test public void testHtmlEncode() throws Exception { String test = "<test>"; vars.put("test", test); ValueExpression testHtmlEncode = expressions.parse("${os:htmlEncode(test)}", String.class); assertEquals("&lt;test&gt;", testHtmlEncode.getValue(context)); }