@SuppressWarnings("unchecked")
  public DATA_TYPE getData() {
    Object data = this.execution.taskInstance.getData();
    if (data == null) {
      return null;
    } else if (dataClass.isInstance(data)) {
      return (DATA_TYPE) data;
    }
    throw new DataClassMismatchException(dataClass, data.getClass());
  }
@Test
  public void test_data_class_type_not_equals() {
    DataClassMismatchException dataClassMismatchException =
        assertThrows(
            DataClassMismatchException.class,
            () -> {
              Instant now = Instant.now();
              OneTimeTask<Integer> task =
                  TestTasks.oneTime("OneTime", Integer.class, (instance, executionContext) -> {});
              Execution execution =
                  new Execution(
                      now, task.instance("id1", new Integer(1))); // Data class is an integer

              new ScheduledExecution<>(String.class, execution)
                  .getData(); // Instantiate with incorrect type
            });

    assertThat(
        dataClassMismatchException.getMessage(), CoreMatchers.containsString("Task data mismatch"));
  }