public JobInformation getJobInformation() throws IOException, ClassNotFoundException {
        if (jobInformation != null) {
            return jobInformation;
        }
        if (serializedJobInformation instanceof NonOffloaded) {
            NonOffloaded<JobInformation> jobInformation =
                    (NonOffloaded<JobInformation>) serializedJobInformation;
            return jobInformation.serializedValue.deserializeValue(getClass().getClassLoader());
        }
        throw new IllegalStateException(
                "Trying to work with offloaded serialized job information.");
    }
@Test
    void testOffLoadedAndNonOffLoadedPayload() throws IOException, ClassNotFoundException {
        final TaskDeploymentDescriptor taskDeploymentDescriptor =
                createTaskDeploymentDescriptor(
                        new TaskDeploymentDescriptor.NonOffloaded<>(serializedJobInformation),
                        new TaskDeploymentDescriptor.Offloaded<>(new PermanentBlobKey()));

        JobInformation actualJobInformation = taskDeploymentDescriptor.getJobInformation();
        assertThat(actualJobInformation).isEqualTo(jobInformation);

        assertThatThrownBy(taskDeploymentDescriptor::getTaskInformation)
                .isInstanceOf(IllegalStateException.class);
    }