private void addWrappedCall(ClassFile cf, CodeBuilder b, Method m) {
        // Special behavior for equals method
        boolean isEqualsMethod = false;
        if (m.getName().equals("equals") && m.getReturnType().equals(boolean.class)) {
            Class[] paramTypes = m.getParameterTypes();
            isEqualsMethod = paramTypes.length == 1 && paramTypes[0].equals(Object.class);
        }

        if (isEqualsMethod) {
            b.loadThis();
            b.loadLocal(b.getParameter(0));
            Label notEqual = b.createLabel();
            b.ifEqualBranch(notEqual, false);
            b.loadConstant(true);
            b.returnValue(TypeDesc.BOOLEAN);

            notEqual.setLocation();

            // Check if object is our type.
            b.loadLocal(b.getParameter(0));
            b.instanceOf(cf.getType());
            Label isInstance = b.createLabel();
            b.ifZeroComparisonBranch(isInstance, "!=");

            b.loadConstant(false);
            b.returnValue(TypeDesc.BOOLEAN);

            isInstance.setLocation();
        }

        final TypeDesc atomicRefType = TypeDesc.forClass(AtomicReference.class);

        // Load wrapped object...
        b.loadThis();
        b.loadField(REF_FIELD_NAME, atomicRefType);
        b.invokeVirtual(atomicRefType, "get", TypeDesc.OBJECT, null);
        b.checkCast(TypeDesc.forClass(mType));

        // Load parameters...
        for (int i=0; i<b.getParameterCount(); i++) {
            b.loadLocal(b.getParameter(i));
        }

        // Special behavior for equals method
        if (isEqualsMethod) {
            // Extract wrapped object.
            b.checkCast(cf.getType());
            b.loadField(REF_FIELD_NAME, atomicRefType);
            b.invokeVirtual(atomicRefType, "get", TypeDesc.OBJECT, null);
            b.checkCast(TypeDesc.forClass(mType));
        }

        // Invoke wrapped method...
        b.invoke(m);

        if (m.getReturnType() == void.class) {
            b.returnVoid();
        } else {
            b.returnValue(TypeDesc.forClass(m.getReturnType()));
        }
    }