class CmsPsuService {

    public Optional<PsuData> definePsuDataForAuthorisation(PsuData psuDataForCheck, List<PsuData> psuDataList) {
        return Optional.ofNullable(psuDataForCheck)
                   .map(psuData -> psuDataList.stream()
                                       .filter(psu -> StringUtils.equals(psu.getPsuId(), psuData.getPsuId()))
                                       .findFirst()
                                       .orElse(psuDataForCheck));
    }

}