public static IUser convertFromProxyPentahoUser( IUserRoleWebService userRoleWebService, ProxyPentahoUser user,
      UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ) {
    IUser userInfo = null;
    try {
      userInfo = rsm.constructUser();
      userInfo.setDescription( user.getDescription() );
      userInfo.setPassword( user.getPassword() );
      userInfo.setLogin( user.getName() );
      userInfo.setName( user.getName() );
      try {
        if ( userInfo instanceof IEEUser ) {
          ( (IEEUser) userInfo ).setRoles( convertToSetFromProxyPentahoRoles(
              userRoleWebService.getRolesForUser( user ), lookupCache ) );
        }
      } catch ( UserRoleException e ) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    } catch ( KettleException e1 ) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
    return userInfo;
  }
@Test
  public void convertFromProxyPentahoUser_CopiesRolesForEeUser() throws Exception {
    IRoleSupportSecurityManager manager = mockSecurityManager( true );

    ProxyPentahoUser pentahoUser = pentahoUser( "name" );

    List<UserToRoleAssignment> assignments = Collections.singletonList( new UserToRoleAssignment( "name", "role" ) );
    EEUserInfo user = (EEUserInfo) convertFromProxyPentahoUser( pentahoUser, assignments, manager );
    assertNotNull( user );
    assertEquals( pentahoUser.getName(), user.getName() );
    assertEquals( 1, user.getRoles().size() );
    assertEquals( "role", user.getRoles().iterator().next().getName() );
  }