class TppStopListServiceInternal implements TppStopListService {

    @Override
    public CmsResponse<Boolean> checkIfTppBlocked(String tppAuthorisationNumber, String instanceId) {
        String requestedInstanceId = StringUtils.isBlank(instanceId) ? serviceInstanceId : instanceId;
        Optional<TppStopListEntity> stopListEntityOptional = tppStopListRepository.findByTppAuthorisationNumberAndInstanceId(tppAuthorisationNumber,
                                                                                                                             requestedInstanceId);

        Boolean blocked = stopListEntityOptional
                              .filter(TppStopListEntity::isBlocked)
                              .map(sl -> {
                                  log.info("TPP ID: [{}]. TPP has been blocked, because it's in stop list",
                                           tppAuthorisationNumber);
                                  return true;
                              })
                              .orElse(false);

        return CmsResponse.<Boolean>builder()
                   .payload(blocked)
                   .build();
    }

}