public static String toJson(FileScanTask fileScanTask) {
    Preconditions.checkArgument(fileScanTask != null, "Invalid scan task: null");
    return JsonUtil.generate(generator -> toJson(fileScanTask, generator), false);
  }
@Test
  public void unsupportedTask() {
    FileScanTask mockTask = Mockito.mock(FileScanTask.class);
    assertThatThrownBy(() -> ScanTaskParser.toJson(mockTask))
        .isInstanceOf(UnsupportedOperationException.class)
        .hasMessageContaining(
            "Unsupported task type: org.apache.iceberg.FileScanTask$MockitoMock$");
  }