question: @ Override protected TemplateModel invokeGenericGet ( Map keyMap , Class clazz , String key ) throws TemplateModelException { Map map = ( Map ) object ; Object val = map . get ( key ) ; if ( val == null ) { if ( key . length ( ) == 1 ) { Character charKey = Character . valueOf ( key . charAt ( 0 ) ) ; val = map . get ( charKey ) ; if ( val == null && ! ( map . containsKey ( key ) || map . containsKey ( charKey ) ) ) { return UNKNOWN ; } } else if ( ! map . containsKey ( key ) ) { return UNKNOWN ; } } return wrap ( val ) ; }
target:  Overridden to invoke the generic get method by casting to Map instead of  through reflection - should yield better performance.