improve JavaMap adaptor