class AuthorisationServiceInternal implements AuthorisationService {

    @Transactional(readOnly = true)
    @Override
    public CmsResponse<Boolean> isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId) {
        Optional<AuthorisationEntity> authorisationOptional = getAuthorisation(authorisationId);

        Optional<Boolean> isDecoupledOptional = authorisationOptional.map(a -> a.getAvailableScaMethods()
                                                                                   .stream()
                                                                                   .filter(m -> Objects.equals(m.getAuthenticationMethodId(), authenticationMethodId))
                                                                                   .anyMatch(ScaMethod::isDecoupled));
        if (isDecoupledOptional.isPresent()) {
            return CmsResponse.<Boolean>builder()
                       .payload(isDecoupledOptional.get())
                       .build();
        }

        log.info("Authorisation ID: [{}]. Check whether authentication method is decoupled has failed, because authorisation with such method couldn't be found",
                 authorisationId);
        return CmsResponse.<Boolean>builder()
                   .payload(false)
                   .build();
    }

}