Program: 136242
Project: 136242
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void moveMemberTests() throws Exception {
  LibraryChainNode fromChain=ml.createNewManagedLibrary("String_Node_Str",defaultProject);
  LibraryChainNode toChain=ml.createNewManagedLibrary("String_Node_Str",defaultProject);
  LibraryNode fromLib=ml.createNewLibrary("String_Node_Str","String_Node_Str",defaultProject);
  LibraryNode toLib=ml.createNewLibrary("String_Node_Str","String_Node_Str",defaultProject);
  Assert.assertTrue(fromLib.isEditable());
  Assert.assertTrue(toLib.isEditable());
  List<TLContext> toLibContexts=toLib.getTLLibrary().getContexts();
  List<TLContext> fromLibContexts=fromLib.getTLLibrary().getContexts();
  Node object=addContextUsers(fromLib);
  Assert.assertEquals(2,fromLibContexts.size());
  object.getLibrary().moveMember(object,toLib);
  Assert.assertEquals(2,fromLibContexts.size());
  Assert.assertEquals(1,toLibContexts.size());
  Assert.assertEquals(2,toLib.getDescendants_LibraryMembers().size());
  ModelNode model=mc.getModelNode();
  lf.loadTestGroupA(mc);
  int count=toLib.getDescendants_LibraryMembers().size();
  for (  LibraryNode ln : model.getUserLibraries()) {
    if (ln != toLib && ln != fromLib) {
      LibraryChainNode lcn;
      if (ln.isInChain())       lcn=ln.getChain();
 else       lcn=new LibraryChainNode(ln);
      int libCount=ln.getDescendants_LibraryMembers().size();
      for (      Node n : ln.getDescendants_LibraryMembers()) {
        if (n instanceof ServiceNode)         continue;
        LOGGER.debug("String_Node_Str" + n + "String_Node_Str"+ n.getLibrary()+ "String_Node_Str"+ toLib);
        if (n.getLibrary().moveMember(n,toLib))         count++;
        if (libCount - 1 != ln.getDescendants_LibraryMembers().size()) {
          List<Node> dl=ln.getDescendants_LibraryMembers();
          LOGGER.debug("String_Node_Str" + dl.size());
        }
        int toCount=toLib.getDescendants_LibraryMembers().size();
        if (count != toCount) {
          LOGGER.debug("String_Node_Str" + n);
        }
      }
    }
  }
  Assert.assertEquals(1,toLibContexts.size());
  Assert.assertEquals(count,toLib.getDescendants_LibraryMembers().size());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void moveMemberTests() throws Exception {
  LibraryChainNode fromChain=ml.createNewManagedLibrary("String_Node_Str",defaultProject);
  LibraryChainNode toChain=ml.createNewManagedLibrary("String_Node_Str",defaultProject);
  LibraryNode fromLib=ml.createNewLibrary("String_Node_Str","String_Node_Str",defaultProject);
  LibraryNode toLib=ml.createNewLibrary("String_Node_Str","String_Node_Str",defaultProject);
  Assert.assertTrue(fromLib.isEditable());
  Assert.assertTrue(toLib.isEditable());
  List<TLContext> toLibContexts=toLib.getTLLibrary().getContexts();
  List<TLContext> fromLibContexts=fromLib.getTLLibrary().getContexts();
  assertTrue(Node.GetNode(toLib.getTLLibrary()) == toLib);
  assertTrue(Node.GetNode(fromLib.getTLLibrary()) == fromLib);
  Node object=addContextUsers(fromLib);
  Assert.assertEquals(2,fromLibContexts.size());
  object.getLibrary().moveMember(object,toLib);
  Assert.assertEquals(2,fromLibContexts.size());
  Assert.assertEquals(1,toLibContexts.size());
  Assert.assertEquals(2,toLib.getDescendants_LibraryMembers().size());
  ModelNode model=mc.getModelNode();
  lf.loadTestGroupA(mc);
  assertTrue(Node.GetNode(toLib.getTLLibrary()) == toLib);
  int count=toLib.getDescendants_LibraryMembers().size();
  for (  LibraryNode ln : model.getUserLibraries()) {
    if (ln != toLib && ln != fromLib) {
      int libCount=ln.getDescendants_LibraryMembers().size();
      assertTrue(Node.GetNode(ln.getTLLibrary()) == ln);
      for (      Node n : ln.getDescendants_LibraryMembers()) {
        if (n instanceof ServiceNode)         continue;
        LOGGER.debug("String_Node_Str" + n + "String_Node_Str"+ n.getLibrary()+ "String_Node_Str"+ toLib);
        assertTrue(n.getLibrary() == ln);
        if (n.getLibrary().moveMember(n,toLib))         count++;
        assertTrue("String_Node_Str",toLib.getDescendants_LibraryMembers().contains(n));
        if (libCount - 1 != ln.getDescendants_LibraryMembers().size()) {
          List<Node> dl=ln.getDescendants_LibraryMembers();
          LOGGER.debug("String_Node_Str" + dl.size());
        }
        int toCount=toLib.getDescendants_LibraryMembers().size();
        if (count != toCount) {
          LOGGER.debug("String_Node_Str" + n);
        }
      }
    }
  }
  Assert.assertEquals(1,toLibContexts.size());
  Assert.assertEquals(count,toLib.getDescendants_LibraryMembers().size());
}