code: def test_with_idleness(self):
      jvm = get_gateway().jvm
      j_watermark_strategy = (
          WatermarkStrategy.no_watermarks()
          .with_idleness(Duration.of_seconds(5))
          ._j_watermark_strategy
      )
      self.assertTrue(
          is_instance_of(
              j_watermark_strategy,
              jvm.org.apache.flink.api.common.eventtime.WatermarkStrategyWithIdleness,
          )
      )
      self.assertEqual(
          get_field_value(
              j_watermark_strategy, "idlenessTimeout"
          ).toMillis(),
          5000,
      )
  
file_path: flink/flink-python/pyflink/common/tests/test_watermark_strategy.py
imports: from pyflink.common import Duration
  from pyflink.common.watermark_strategy import WatermarkStrategy
  from pyflink.java_gateway import get_gateway
  from pyflink.util.java_utils import is_instance_of, get_field_value
  from pyflink.testing.test_case_utils import PyFlinkTestCase
label_desc: Use image node_id 1 for calling the WatermarkStrategyTests obj's underlying member method code with example usage: obj.test_with_idleness() without return types