@SuppressWarnings("unchecked")
    @Test
    public void testIssue889() throws IllegalAccessException, NoSuchFieldException {
        // throws are added so that we don't have to catch them just to assert them again.
        // If they throw, the Unit Test should fail
        Field f1 = PhysicsSpace.class.getDeclaredField("tickListeners");
        f1.setAccessible(true);
        Field f2 = BetterCharacterControl.class.getDeclaredField("rigidBody");
        f2.setAccessible(true);

        BulletAppState bulletAppState = new BulletAppState();
        bulletAppState.setSpeed(0f);
        bulletAppState.startPhysics(); // so that we don't need an AppStateManager etc
        PhysicsSpace space = bulletAppState.getPhysicsSpace();
        ConcurrentLinkedQueue<PhysicsTickListener> tickListeners = (ConcurrentLinkedQueue<PhysicsTickListener>)f1.get(space);

        float radius = 1f;
        CollisionShape sphere = new SphereCollisionShape(radius);
        CollisionShape box = new BoxCollisionShape(Vector3f.UNIT_XYZ);

        Node rootNode = new Node("RootNode");

        RigidBodyControl rbc = new RigidBodyControl(box);
        rbc.setEnabled(false);
        rbc.setPhysicsSpace(space);
        rootNode.addControl(rbc);

        BetterCharacterControl bcc = new BetterCharacterControl(radius, 4f, 1f);
        bcc.setEnabled(false);
        bcc.setPhysicsSpace(space);
        rootNode.addControl(bcc);
        PhysicsRigidBody bcc_rb = (PhysicsRigidBody)f2.get(bcc);

        GhostControl gc = new GhostControl(sphere);
        gc.setEnabled(false);
        gc.setPhysicsSpace(space);
        rootNode.addControl(gc);

        Assert.assertFalse(space.getRigidBodyList().contains(rbc));
        Assert.assertFalse(tickListeners.contains(bcc));
        Assert.assertFalse(space.getRigidBodyList().contains(bcc_rb));
        Assert.assertFalse(space.getGhostObjectList().contains(gc));
    }
Test case for JME issue #889: disabled physics control gets added to a
physics space.
jme3-jbullet/src/test/java/com/jme3/jbullet/test/PreventBulletIssueRegressions.java