public static Map<String, String> resolveAttachments(Object invocation, boolean isApache) {
        if (invocation == null) {
            return Collections.emptyMap();
        }
        final Map<String, String> attachments = new HashMap<>();
        if (isApache) {
            attachments.putAll(getAttachmentsFromContext(APACHE_RPC_CONTEXT));
        } else {
            attachments.putAll(getAttachmentsFromContext(ALIBABA_RPC_CONTEXT));
        }
        final Optional<Object> fieldValue = ReflectUtils.getFieldValue(invocation, ATTACHMENTS_FIELD);
        if (fieldValue.isPresent() && fieldValue.get() instanceof Map) {
            attachments.putAll((Map<String, String>) fieldValue.get());
        }
        return Collections.unmodifiableMap(attachments);
    }
@Test
    public void testAlibabaInvocation() {
        final TestStringInvocation testStringInvocation = new TestStringInvocation(null);
        String key = "a";
        String value = "c";
        com.alibaba.dubbo.rpc.RpcContext.getContext().getAttachments().put(key, value);
        final Map<String, String> map = DubboAttachmentsHelper.resolveAttachments(testStringInvocation, false);
        Assert.assertEquals(map.get(key), value);
        com.alibaba.dubbo.rpc.RpcContext.getContext().getAttachments().clear();
    }