class FactorServiceImpl implements FactorService {

    @Override
    public List<SecurityQuestion> listSecurityQuestions(OktaUser user) throws OktaException
    {
        if (user != null)
        {
            String apiPath = String.format(OktaAPIConstants.LIST_SECURITY_QUESTIONS, user.getId());
            ResponseEntity<SecurityQuestion[]> exchange = oktaRestService.doRestCall(apiPath, HttpMethod.GET, SecurityQuestion[].class,
                    "parameters");
            if (!exchange.getStatusCode().is2xxSuccessful())
            {
                throw new OktaException(exchange.toString());
            }

            if (exchange.getBody().length > 0)
            {
                return Arrays.asList(exchange.getBody());
            }
        }
        return Collections.emptyList();
    }

}