Program: 31324
Project: 31324
Buggy source:
/** 
 * Test of setCurrentUser method, of class org.owasp.esapi.Authenticator.
 * @throws AuthenticationException the authentication exception
 */
public void testSetCurrentUser() throws AuthenticationException {
  System.out.println("String_Node_Str");
  final Authenticator instance=ESAPI.authenticator();
  String user1=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_UPPERS);
  String user2=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_UPPERS);
  User userOne=instance.createUser(user1,"String_Node_Str","String_Node_Str");
  userOne.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  userOne.loginWithPassword("String_Node_Str");
  User currentUser=instance.getCurrentUser();
  assertEquals(currentUser,userOne);
  User userTwo=instance.createUser(user2,"String_Node_Str","String_Node_Str");
  instance.setCurrentUser(userTwo);
  assertFalse(currentUser.getAccountName().equals(userTwo.getAccountName()));
  Runnable echo=new Runnable(){
    private int count=1;
    public void run(){
      User u=null;
      try {
        String password=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
        u=instance.createUser("String_Node_Str" + count++,password,password);
        instance.setCurrentUser(u);
        ESAPI.getLogger("String_Node_Str").info(Logger.SECURITY_SUCCESS,"String_Node_Str");
      }
 catch (      AuthenticationException e) {
        e.printStackTrace();
      }
    }
  }
;
  for (int i=0; i < 10; i++) {
    new Thread(echo).start();
  }
}

Fixed version (ground truth):
/** 
 * Test of setCurrentUser method, of class org.owasp.esapi.Authenticator.
 * @throws AuthenticationException the authentication exception
 */
public void testSetCurrentUser() throws AuthenticationException {
  System.out.println("String_Node_Str");
  final Authenticator instance=ESAPI.authenticator();
  String user1=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_UPPERS);
  String user2=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_UPPERS);
  User userOne=instance.createUser(user1,"String_Node_Str","String_Node_Str");
  userOne.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  userOne.loginWithPassword("String_Node_Str");
  User currentUser=instance.getCurrentUser();
  assertEquals(currentUser,userOne);
  User userTwo=instance.createUser(user2,"String_Node_Str","String_Node_Str");
  instance.setCurrentUser(userTwo);
  assertFalse(currentUser.getAccountName().equals(userTwo.getAccountName()));
  Runnable echo=new Runnable(){
    private int count=1;
    public void run(){
      User u=null;
      try {
        String password=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
        u=instance.createUser("String_Node_Str" + count++,password,password);
        instance.setCurrentUser(u);
        ESAPI.getLogger("String_Node_Str").info(Logger.SECURITY_SUCCESS,"String_Node_Str");
      }
 catch (      AuthenticationException e) {
        e.printStackTrace();
      }
    }
  }
;
  for (int i=0; i < 10; i++) {
    new Thread(echo).start();
  }
}