Mistři v programování na #hovnokod

Java #4631

optional.toString() zabil

        Optional<String> optional = mappingService.mapToOrderId(country, productId);
        String offerId;
        if (optional.isPresent()) {
            offerId = optional.toString();
        } else {
            throw new RuntimeException("No OfferId found.");
        }
        System.out.println(offerId);

Anonymous,