Source:
<code>private Result<Subscription> createSubscriptionInternal(final SubscriptionBase subscriptionBase, final Client client) throws InternalNakadiException, DuplicatedSubscriptionException, ServiceUnavailableException { final Map<String, Optional<EventType>> eventTypeMapping = subscriptionBase.getEventTypes().stream() .collect(Collectors.toMap(Function.identity(), Try.wrap(eventTypeRepository::findByNameO).andThen(Try::getOrThrow))); final List<String> missingEventTypes = eventTypeMapping.entrySet().stream() .filter(entry -> !entry.getValue().isPresent()) .map(Map.Entry::getKey) .collect(Collectors.toList()); if (!missingEventTypes.isEmpty()) { final Problem problem = Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, createMissingEventsErrorMessage(missingEventTypes)); return Result.problem(problem); } eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(eventType -> client.checkScopes(eventType.getReadScopes())); final int totalPartitions = eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .map(et -> topicRepository.listPartitionNames(et.getTopic())) .mapToInt(List::size) .sum(); if (totalPartitions > maxSubscriptionPartitions) { final String message = String.format( <START> "total partition count for subscription is %d while only %d allowed", <END> totalPartitions, maxSubscriptionPartitions); return Result.problem(Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, message)); } final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); return Result.ok(subscription); }</code><technical_language>I suggest total partition count for subscription is %d, maximum partition count is %d</technical_language>

Target:
private Result<Subscription> createSubscriptionInternal(final SubscriptionBase subscriptionBase, final Client client) throws InternalNakadiException, DuplicatedSubscriptionException, ServiceUnavailableException { final Map<String, Optional<EventType>> eventTypeMapping = subscriptionBase.getEventTypes().stream() .collect(Collectors.toMap(Function.identity(), Try.wrap(eventTypeRepository::findByNameO).andThen(Try::getOrThrow))); final List<String> missingEventTypes = eventTypeMapping.entrySet().stream() .filter(entry -> !entry.getValue().isPresent()) .map(Map.Entry::getKey) .collect(Collectors.toList()); if (!missingEventTypes.isEmpty()) { final Problem problem = Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, createMissingEventsErrorMessage(missingEventTypes)); return Result.problem(problem); } eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(eventType -> client.checkScopes(eventType.getReadScopes())); final int totalPartitions = eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .map(et -> topicRepository.listPartitionNames(et.getTopic())) .mapToInt(List::size) .sum(); if (totalPartitions > maxSubscriptionPartitions) { final String message = String.format( "total partition count for subscription is %d, but the maximum partition count is %d", totalPartitions, maxSubscriptionPartitions); return Result.problem(Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, message)); } final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); return Result.ok(subscription); }