@Override
    public ModelMBean assemble(Object obj, ObjectName name) throws JMException {
        ModelMBeanInfo mbi = null;

        // use the default provided mbean which has been annotated with JMX annotations
        LOGGER.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name, obj);
        mbi = assembler.getMBeanInfo(obj, null, name.toString());

        if (mbi == null) {
            return null;
        }

        RequiredModelMBean mbean = new RequiredModelMBean(mbi);

        try {
            mbean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException e) {
            throw new JMException(e.getMessage());
        }

        // Allows the managed object to send notifications
        if (obj instanceof NotificationSenderAware) {
            ((NotificationSenderAware) obj).setNotificationSender(new NotificationSenderAdapter(mbean));
        }

        return mbean;
    }
@Test
    public void testHappyPath() throws MalformedObjectNameException, JMException {
        TestMbean testMbean = new TestMbean();
        ModelMBean mbean = defaultManagementMBeanAssembler.assemble(testMbean, new ObjectName("org.flowable.jmx.Mbeans:type=something"));
        assertThat(mbean).isNotNull();
        assertThat(mbean.getMBeanInfo()).isNotNull();
        assertThat(mbean.getMBeanInfo().getAttributes()).isNotNull();
        MBeanAttributeInfo[] attributes = mbean.getMBeanInfo().getAttributes();
        assertThat(attributes).hasSize(2);
        assertThat(("TestAttributeString".equals(attributes[0].getName()) && "TestAttributeBoolean".equals(attributes[1].getName()) || (
		        "TestAttributeString".equals(attributes[1].getName()) && "TestAttributeBoolean".equals(attributes[0]
		                .getName())))).isTrue();
        assertThat(mbean.getMBeanInfo().getOperations()).isNotNull();
        MBeanOperationInfo[] operations = mbean.getMBeanInfo().getOperations();
        assertThat(operations).hasSize(3);

    }