private void testStateWindowSSOutOfRange(
      String measurement, String delta, Long displayBegin, Long displayEnd) {
    String sql;
    if (displayBegin == null) {
      if (delta == null) {
        sql =
            String.format(
                "select window_start_end(%s, '%s'='%s') from root.vehicle.d1",
                measurement,
                UDFTestConstant.ACCESS_STRATEGY_KEY,
                UDFTestConstant.ACCESS_STRATEGY_STATE);
      } else {
        sql =
            String.format(
                "select window_start_end(%s, '%s'='%s', '%s'='%s') from root.vehicle.d1",
                measurement,
                UDFTestConstant.ACCESS_STRATEGY_KEY,
                UDFTestConstant.ACCESS_STRATEGY_STATE,
                UDFTestConstant.STATE_DELTA_KEY,
                delta);
      }
    } else {
      sql =
          String.format(
              "select window_start_end(%s, '%s'='%s', '%s'='%s', '%s'='%s', '%s'='%s') from root.vehicle.d1",
              measurement,
              UDFTestConstant.ACCESS_STRATEGY_KEY,
              UDFTestConstant.ACCESS_STRATEGY_STATE,
              UDFTestConstant.DISPLAY_WINDOW_BEGIN_KEY,
              displayBegin,
              UDFTestConstant.DISPLAY_WINDOW_END_KEY,
              displayEnd,
              UDFTestConstant.STATE_DELTA_KEY,
              delta);
    }

    try (Connection conn = EnvFactory.getEnv().getConnection();
        Statement statement = conn.createStatement();
        ResultSet resultSet = statement.executeQuery(sql)) {
      int count = 0;
      while (resultSet.next()) {
        count++;
      }
      assertEquals(count, 0);
    } catch (SQLException e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
  }
Test for SessionWindow, StateWindow and UserDefinedWindow.
integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java