### Question:
Functions extends FunctionMapper { @Override public Method resolveFunction(String prefix, String methodName) { Map<String, Method> prefixMap = functions.get(prefix); if (prefixMap == null) { return null; } return prefixMap.get(methodName); } Functions(Class<?>... functionClasses); @Override Method resolveFunction(String prefix, String methodName);  }### Answer:
@Test public void testExpose() throws Exception { Method hi = functions.resolveFunction("test", "hi"); assertEquals("hi", hi.invoke(null)); Method hiAlternate = functions.resolveFunction("test", "hola"); assertEquals("hi", hiAlternate.invoke(null)); Method bonjour = functions.resolveFunction("other", "bonjour"); assertEquals("French hello", bonjour.invoke(null)); }
@Test public void testNonStaticNotExposed() { assertNull(functions.resolveFunction("test", "goodbye")); }
@Test public void testDefaultBinding() throws Exception { Injector injector = Guice.createInjector(); functions = injector.getInstance(Functions.class); Method toJson = functions.resolveFunction("osx", "parseJson"); Object o = toJson.invoke(null, "{a : 1}"); assertTrue(o instanceof JSONObject); assertEquals(1, ((JSONObject) o).getInt("a")); }