private static <R extends JarRequestBody, M extends MessageParameters>
            List<String> getProgramArgs(HandlerRequest<R> request, Logger log)
                    throws RestHandlerException {
        JarRequestBody requestBody = request.getRequestBody();
        @SuppressWarnings("deprecation")
        List<String> programArgs =
                tokenizeArguments(
                        fromRequestBodyOrQueryParameter(
                                emptyToNull(requestBody.getProgramArguments()),
                                () -> getQueryParameter(request, ProgramArgsQueryParameter.class),
                                null,
                                log));
        List<String> programArgsList =
                fromRequestBodyOrQueryParameter(
                        requestBody.getProgramArgumentsList(),
                        () -> request.getQueryParameter(ProgramArgQueryParameter.class),
                        null,
                        log);
        if (!programArgsList.isEmpty()) {
            if (!programArgs.isEmpty()) {
                throw new RestHandlerException(
                        "Confusing request: programArgs and programArgsList are specified, please, use only programArgsList",
                        HttpResponseStatus.BAD_REQUEST);
            }
            return programArgsList;
        } else {
            return programArgs;
        }
    }
@Test
    void testFromRequestRequestBody() throws Exception {
        final JarPlanRequestBody requestBody = getDummyJarPlanRequestBody("entry-class", 37, null);
        final HandlerRequest<JarPlanRequestBody> request = getDummyRequest(requestBody);

        final JarHandlerUtils.JarHandlerContext jarHandlerContext =
                JarHandlerUtils.JarHandlerContext.fromRequest(request, tempDir, LOG);
        assertThat(jarHandlerContext.getEntryClass()).isEqualTo(requestBody.getEntryClassName());
        assertThat(jarHandlerContext.getProgramArgs())
                .containsExactlyElementsOf(requestBody.getProgramArgumentsList());
        assertThat(jarHandlerContext.getParallelism()).isEqualTo(requestBody.getParallelism());
        assertThat(jarHandlerContext.getJobId()).isEqualTo(requestBody.getJobId());
    }