private int getUserIndex(String username) {
    if (username != null) {
      int index = 0;
      for (User user : listAdapter.getItems()) {
        if (user.getUsername().toUpperCase().trim().equals(username.toUpperCase().trim())) break;
        index++;
      }
      return index;
    }

    return 0;
  }
 @Test(timeout = TIMEOUT)
 public void userWithNoDetailsDoesNotContainTwitterHandle() throws CoderWallException {
   CoderWall cw = new CoderWallImpl();
   User bjoern = cw.getUser("bkimminich", false);
   assertThat(bjoern.getAccounts().getTwitter(), is(nullValue()));
 }
 @Test(timeout = TIMEOUT)
 public void userWithFullDetailsContainsTwitterHandle() throws CoderWallException {
   CoderWall cw = new CoderWallImpl();
   User bjoern = cw.getUser("bkimminich");
   assertThat(bjoern.getAccounts().getTwitter(), is("bkimminich"));
 }