int messageID = message.getID();
// Original message thread rootMessageID
int oldRootMessageID = getRootMessage().getID();
// Move the children of this message to the new thread
TreeWalker walker = treeWalker();
int childCount = walker.getChildCount(message);
for (int i = 0; i < childCount; i++) {
Message childMessage = walker.getChild(message, i);
changeMessageThread(childMessage, newThread);
}
//Move the message to the new thread.
changeMessageThread(message, newThread);