class StackDownscaleValidatorService {

    public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) {
        if (!Objects.equals(owner, userId)) {
            throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId));
        }
    }

}