@Test
public void testPositionalParams() {

  String queryStr = "select foo, bar from test_ks.test_tab where foo = ? and bar = ?";
  LinkedHashMap<String, String> paramTypes = new LinkedHashMap<>();
  paramTypes.put("foo", "varchar");
  paramTypes.put("bar", "int");
  LinkedHashMap<String, Object> params = new LinkedHashMap<>();
  params.put("foo", "any");
  params.put("bar", 100);
  Query selectQuery = new Query(queryStr, new String[] {}, params, paramTypes);
  List<ByteBuffer> positionalParamValues =
      Arrays.asList(
          ByteBuffer.wrap("any".getBytes(StandardCharsets.UTF_8)),
          ByteBuffer.wrap(new byte[] {0, 0, 0, 100}));
  QueryOptions queryOptions =
      new QueryOptions(
          0, positionalParamValues, Collections.emptyMap(), true, 0, null, 10, -1, null);
  com.datastax.oss.protocol.internal.request.Query simpleQueryWithValidPositionalParams =
      new com.datastax.oss.protocol.internal.request.Query(queryStr, queryOptions);
  assertThat(selectQuery.matches(FrameUtils.wrapRequest(simpleQueryWithValidPositionalParams)))
      .isTrue();
  List<ByteBuffer> reverseOrderedPositionalParamValues =
      Arrays.asList(
          ByteBuffer.wrap(new byte[] {0, 0, 0, 100}),
          ByteBuffer.wrap("any".getBytes(StandardCharsets.UTF_8)));
  QueryOptions invalidQueryOptions =
      new QueryOptions(
          0,
          reverseOrderedPositionalParamValues,
          Collections.emptyMap(),
          true,
          0,
          null,
          10,
          -1,
          null);
  com.datastax.oss.protocol.internal.request.Query simpleQueryWithInvalidPositionalParams =
      new com.datastax.oss.protocol.internal.request.Query(queryStr, invalidQueryOptions);
  assertThat(selectQuery.matches(FrameUtils.wrapRequest(simpleQueryWithInvalidPositionalParams)))
      .isFalse();
}