code: public UserPrincipal getUserPrincipal(String username) {
          final UserPrincipal principal = getManagedUser(username);
          if (principal != null) {
              return principal;
          }
          return getLdapUser(username);
      }
docs: Resolves a UserPrincipal. Default order resolution is to first match
  on ManagedUser then on LdapUser. This may be configurable in a future
  release.
  @param username the username of the principal to retrieve
  @return a UserPrincipal if found, null if not found
  @since 1.0.0