Program: 147589
Project: 147589
Buggy source:
@Before public void setUp() throws Exception {
  ResourceBundle rb=mock(ResourceBundle.class);
  stub(method(ResourceBundle.class,"String_Node_Str",String.class)).toReturn(rb);
  PowerMockito.mockStatic(JFaceResources.class);
  ImageRegistry registry=mock(ImageRegistry.class);
  when(JFaceResources.getImageRegistry()).thenReturn(registry);
  PowerMockito.mockStatic(DefaultMessagesImpl.class);
  when(DefaultMessagesImpl.getString(anyString())).thenReturn("String_Node_Str");
  IRepositoryResourceUtilExAdapter mockAdapter=PowerMockito.mock(IRepositoryResourceUtilExAdapter.class);
  PowerMockito.mockStatic(ExAdapterManager.class);
  PowerMockito.when(ExAdapterManager.getAdapter(new RepositoryResourceUtil(),IRepositoryResourceUtilExAdapter.class)).thenReturn(mockAdapter);
  PowerMockito.mockStatic(ImageCache.class);
  ImageDescriptor imgDesc=mock(ImageDescriptor.class);
  when(ImageCache.getImage(anyString())).thenReturn(imgDesc);
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRuntimePlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntimePlugin);
  RepositoryContext contextMock=mock(RepositoryContext.class);
  PowerMockito.mockStatic(ProjectManager.class);
  ProjectManager pmMock=mock(ProjectManager.class);
  projectM=mock(Project.class);
  User userMock=mock(User.class);
  when(userMock.getLogin()).thenReturn("String_Node_Str");
  when(projectM.getAuthor()).thenReturn(userMock);
  when(pmMock.getCurrentProject()).thenReturn(projectM);
  when(ProjectManager.getInstance()).thenReturn(pmMock);
  when(contextMock.getUser()).thenReturn(userMock);
  repositoryFactory=mock(IProxyRepositoryFactory.class);
  when(CoreRuntimePlugin.getInstance().getProxyRepositoryFactory()).thenReturn(repositoryFactory);
  RecycleBinNodeConfiguration recycleBinNodeConfiguration=mock(RecycleBinNodeConfiguration.class);
  PowerMockito.whenNew(RecycleBinNodeConfiguration.class).withNoArguments().thenReturn(recycleBinNodeConfiguration);
  PowerMockito.mockStatic(ProxyRepositoryFactory.class);
  ProxyRepositoryFactory proxyRepositoryFactory=mock(ProxyRepositoryFactory.class);
  when(ProxyRepositoryFactory.getInstance()).thenReturn(proxyRepositoryFactory);
  IRepositoryFactory repositoryFactoryMock=mock(IRepositoryFactory.class);
  when(proxyRepositoryFactory.getRepositoryFactoryFromProvider()).thenReturn(repositoryFactoryMock);
  XmiResourceManager xmiResourceManager=mock(XmiResourceManager.class);
  when(repositoryFactoryMock.getResourceManager()).thenReturn(xmiResourceManager);
  PowerMockito.mockStatic(RepositoryNodeConfigurationManager.class);
  IRepositoryNodeConfiguration rncMock=mock(IRepositoryNodeConfiguration.class);
  when(RepositoryNodeConfigurationManager.getConfiguration((Item)anyObject())).thenReturn(rncMock);
  resourceProviderM=mock(IRepositoryNodeResourceProvider.class);
  when(rncMock.getResourceProvider()).thenReturn(resourceProviderM);
  when(repositoryFactory.isEditableAndLockIfPossible((Item)anyObject())).thenReturn(true);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  ResourceBundle rb=mock(ResourceBundle.class);
  stub(method(ResourceBundle.class,"String_Node_Str",String.class)).toReturn(rb);
  PowerMockito.mockStatic(JFaceResources.class);
  ImageRegistry registry=mock(ImageRegistry.class);
  when(JFaceResources.getImageRegistry()).thenReturn(registry);
  PowerMockito.mockStatic(DefaultMessagesImpl.class);
  when(DefaultMessagesImpl.getString(anyString())).thenReturn("String_Node_Str");
  IRepositoryResourceUtilExAdapter mockAdapter=PowerMockito.mock(IRepositoryResourceUtilExAdapter.class);
  PowerMockito.mockStatic(ExAdapterManager.class);
  PowerMockito.when(ExAdapterManager.getAdapter(new RepositoryResourceUtil(),IRepositoryResourceUtilExAdapter.class)).thenReturn(mockAdapter);
  PowerMockito.mockStatic(MDMWorbenchPlugin.class);
  when(MDMWorbenchPlugin.getImageDescriptor(anyString())).thenReturn(mock(ImageDescriptor.class));
  PowerMockito.mockStatic(ImageCache.class);
  ImageDescriptor imgDesc=mock(ImageDescriptor.class);
  when(ImageCache.getImage(anyString())).thenReturn(imgDesc);
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  CoreRuntimePlugin coreRuntimePlugin=mock(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntimePlugin);
  RepositoryContext contextMock=mock(RepositoryContext.class);
  PowerMockito.mockStatic(ProjectManager.class);
  ProjectManager pmMock=mock(ProjectManager.class);
  projectM=mock(Project.class);
  User userMock=mock(User.class);
  when(userMock.getLogin()).thenReturn("String_Node_Str");
  when(projectM.getAuthor()).thenReturn(userMock);
  when(pmMock.getCurrentProject()).thenReturn(projectM);
  when(ProjectManager.getInstance()).thenReturn(pmMock);
  when(contextMock.getUser()).thenReturn(userMock);
  repositoryFactory=mock(IProxyRepositoryFactory.class);
  when(CoreRuntimePlugin.getInstance().getProxyRepositoryFactory()).thenReturn(repositoryFactory);
  RecycleBinNodeConfiguration recycleBinNodeConfiguration=mock(RecycleBinNodeConfiguration.class);
  PowerMockito.whenNew(RecycleBinNodeConfiguration.class).withNoArguments().thenReturn(recycleBinNodeConfiguration);
  PowerMockito.mockStatic(ProxyRepositoryFactory.class);
  ProxyRepositoryFactory proxyRepositoryFactory=mock(ProxyRepositoryFactory.class);
  when(ProxyRepositoryFactory.getInstance()).thenReturn(proxyRepositoryFactory);
  IRepositoryFactory repositoryFactoryMock=mock(IRepositoryFactory.class);
  when(proxyRepositoryFactory.getRepositoryFactoryFromProvider()).thenReturn(repositoryFactoryMock);
  XmiResourceManager xmiResourceManager=mock(XmiResourceManager.class);
  when(repositoryFactoryMock.getResourceManager()).thenReturn(xmiResourceManager);
  PowerMockito.mockStatic(RepositoryNodeConfigurationManager.class);
  IRepositoryNodeConfiguration rncMock=mock(IRepositoryNodeConfiguration.class);
  when(RepositoryNodeConfigurationManager.getConfiguration((Item)anyObject())).thenReturn(rncMock);
  resourceProviderM=mock(IRepositoryNodeResourceProvider.class);
  when(rncMock.getResourceProvider()).thenReturn(resourceProviderM);
  when(repositoryFactory.isEditableAndLockIfPossible((Item)anyObject())).thenReturn(true);
}