Program: 85145
Project: 85145
Buggy source:
@Test public void testGetMenuSuccessfully() throws Exception {
  url=url.addParameter(Constants.MERGER_KEY,"String_Node_Str");
  EasyMock.expect(invocation.getMethodName()).andReturn("String_Node_Str").anyTimes();
  EasyMock.expect(invocation.getParameterTypes()).andReturn(new Class<?>[]{}).anyTimes();
  EasyMock.expect(invocation.getArguments()).andReturn(new Object[]{}).anyTimes();
  EasyMock.expect(invocation.getAttachments()).andReturn(new HashMap<String,String>()).anyTimes();
  EasyMock.expect(invocation.getInvoker()).andReturn(firstInvoker).anyTimes();
  EasyMock.replay(invocation);
  firstInvoker=(Invoker)Proxy.newProxyInstance(getClass().getClassLoader(),new Class<?>[]{Invoker.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      if ("String_Node_Str".equals(method.getName())) {
        return url.addParameter(Constants.GROUP_KEY,"String_Node_Str");
      }
      if ("String_Node_Str".equals(method.getName())) {
        return MenuService.class;
      }
      if ("String_Node_Str".equals(method.getName())) {
        return new RpcResult(firstMenu);
      }
      return null;
    }
  }
);
  secondInvoker=(Invoker)Proxy.newProxyInstance(getClass().getClassLoader(),new Class<?>[]{Invoker.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      if ("String_Node_Str".equals(method.getName())) {
        return url.addParameter(Constants.GROUP_KEY,"String_Node_Str");
      }
      if ("String_Node_Str".equals(method.getName())) {
        return MenuService.class;
      }
      if ("String_Node_Str".equals(method.getName())) {
        return new RpcResult(secondMenu);
      }
      return null;
    }
  }
);
  EasyMock.expect(directory.list(invocation)).andReturn(new ArrayList(){
{
      add(firstInvoker);
      add(secondInvoker);
    }
  }
).anyTimes();
  EasyMock.expect(directory.getUrl()).andReturn(url).anyTimes();
  EasyMock.expect(directory.getInterface()).andReturn(MenuService.class).anyTimes();
  EasyMock.replay(directory);
  mergeableClusterInvoker=new MergeableClusterInvoker<MenuService>(directory);
  Result result=mergeableClusterInvoker.invoke(invocation);
  Assert.assertTrue(result.getValue() instanceof Menu);
  Menu menu=(Menu)result.getValue();
  Map<String,List<String>> expected=new HashMap<String,List<String>>();
  merge(expected,firstMenuMap);
  merge(expected,secondMenuMap);
  Assert.assertEquals(expected,menu.getMenus());
}

Fixed version (ground truth):
@Test public void testGetMenuSuccessfully() throws Exception {
  url=url.addParameter(Constants.MERGER_KEY,"String_Node_Str");
  EasyMock.expect(invocation.getMethodName()).andReturn("String_Node_Str").anyTimes();
  EasyMock.expect(invocation.getParameterTypes()).andReturn(new Class<?>[]{}).anyTimes();
  EasyMock.expect(invocation.getArguments()).andReturn(new Object[]{}).anyTimes();
  EasyMock.expect(invocation.getAttachments()).andReturn(new HashMap<String,String>()).anyTimes();
  EasyMock.expect(invocation.getInvoker()).andReturn(firstInvoker).anyTimes();
  EasyMock.replay(invocation);
  firstInvoker=(Invoker)Proxy.newProxyInstance(getClass().getClassLoader(),new Class<?>[]{Invoker.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      if ("String_Node_Str".equals(method.getName())) {
        return url.addParameter(Constants.GROUP_KEY,"String_Node_Str");
      }
      if ("String_Node_Str".equals(method.getName())) {
        return MenuService.class;
      }
      if ("String_Node_Str".equals(method.getName())) {
        return new RpcResult(firstMenu);
      }
      return null;
    }
  }
);
  secondInvoker=(Invoker)Proxy.newProxyInstance(getClass().getClassLoader(),new Class<?>[]{Invoker.class},new InvocationHandler(){
    public Object invoke(    Object proxy,    Method method,    Object[] args) throws Throwable {
      if ("String_Node_Str".equals(method.getName())) {
        return url.addParameter(Constants.GROUP_KEY,"String_Node_Str");
      }
      if ("String_Node_Str".equals(method.getName())) {
        return MenuService.class;
      }
      if ("String_Node_Str".equals(method.getName())) {
        return new RpcResult(secondMenu);
      }
      return null;
    }
  }
);
  EasyMock.expect(directory.list(invocation)).andReturn(new ArrayList(){
{
      add(firstInvoker);
      add(secondInvoker);
    }
  }
).anyTimes();
  EasyMock.expect(directory.getUrl()).andReturn(url).anyTimes();
  EasyMock.expect(directory.getInterface()).andReturn(MenuService.class).anyTimes();
  EasyMock.replay(directory);
  mergeableClusterInvoker=new MergeableClusterInvoker<MenuService>(directory);
  Result result=mergeableClusterInvoker.invoke(invocation);
  Assert.assertTrue(result.getValue() instanceof Menu);
  Menu menu=(Menu)result.getValue();
  Map<String,List<String>> expected=new HashMap<String,List<String>>();
  merge(expected,firstMenuMap);
  merge(expected,secondMenuMap);
  TestCase.assertEquals(expected.keySet(),menu.getMenus().keySet());
  for (  String key : expected.keySet()) {
    List<String> values1=new ArrayList<String>(expected.get(key));
    List<String> values2=new ArrayList<String>(menu.getMenus().get(key));
    Collections.sort(values1);
    Collections.sort(values2);
    TestCase.assertEquals(values1,values2);
  }
}