/** @see DATACMNS-525 */
  @Test
  public void toOrderSpecifierConvertsSimpleDescSortCorrectly() {

    Sort sort = new Sort(Direction.DESC, "firstname");

    OrderSpecifier<?>[] specifiers = toOrderSpecifier(sort, builder);

    assertThat(
        specifiers,
        IsArrayContainingInOrder.<OrderSpecifier<?>>arrayContaining(
            QPerson.person.firstname.desc()));
  }
  /** @see DATACMNS-525 */
  @Test
  public void toOrderSpecifierConvertsSortCorrectlyAndRetainsArgumentOrder() {

    Sort sort = new Sort(Direction.DESC, "firstname").and(new Sort(Direction.ASC, "age"));

    OrderSpecifier<?>[] specifiers = toOrderSpecifier(sort, builder);

    assertThat(
        specifiers,
        IsArrayContainingInOrder.<OrderSpecifier<?>>arrayContaining(
            QPerson.person.firstname.desc(), QPerson.person.age.asc()));
  }
  /** @see DATACMNS-525 */
  @Test
  public void toOrderSpecifierConvertsSortWithNullHandlingCorrectly() {

    Sort sort = new Sort(new Sort.Order(Direction.DESC, "firstname", NullHandling.NULLS_LAST));

    OrderSpecifier<?>[] specifiers = toOrderSpecifier(sort, builder);

    assertThat(
        specifiers,
        IsArrayContainingInOrder.<OrderSpecifier<?>>arrayContaining(
            QPerson.person.firstname.desc().nullsLast()));
  }