public static FileScanTask fromJson(String json, boolean caseSensitive) {
    Preconditions.checkArgument(json != null, "Invalid JSON string for scan task: null");
    return JsonUtil.parse(json, node -> fromJson(node, caseSensitive));
  }
@Test
  public void invalidTaskType() {
    String jsonStr = "{\"task-type\":\"junk\"}";
    assertThatThrownBy(() -> ScanTaskParser.fromJson(jsonStr, true))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Unknown task type: junk");
  }