### Question:
OrderByElement extends SqlQueryBuilderElement { public static Optional<OrderByElement> createOrderByElement(final SqlQueryBuilderAccess queryBuilderAccess) { final QueryParameter queryParameter = queryBuilderAccess.getQueryParameter(); if (queryParameter.getOrders().isEmpty()) { return Optional.absent(); } OrderByElement orderByElement = new OrderByElement(queryBuilderAccess); for (QuerySortConstraint querySortConstraint : queryParameter.getOrders()) { if (queryBuilderAccess.getStarSchemaConfig().isValidDimension(querySortConstraint.getDimensionName())) { final DimensionTable dimension = queryBuilderAccess.getStarSchemaConfig().getDimensionByName(querySortConstraint.getDimensionName(), queryParameter.getTimezoneName()); AbstractSqlColumn columnFromName = null; if (StringUtils.isBlank(querySortConstraint.getInformationName())) { columnFromName = dimension.getDefaultSortColumn().isPresent() ? dimension.getDefaultSortColumn().get() : dimension .getDefaultGroupByColumn(); } else { AbstractSqlColumn informationColumn = dimension.getSqlTableColumnByInformationName(querySortConstraint.getInformationName()); if (informationColumn != null) { columnFromName = informationColumn; } else { if (LOG.isWarnEnabled()) { LOG.warn("Dimension " + dimension.getDimensionName() + " don't have information named: " + querySortConstraint.getInformationName() + "return default."); } columnFromName = dimension.getDefaultSortColumn().isPresent() ? dimension.getDefaultSortColumn().get() : dimension .getDefaultGroupByColumn(); } } orderByElement.addOrderByConstraint(columnFromName, querySortConstraint.getOrderByDirection()); } else { final Optional<AbstractSqlColumn> measure = queryBuilderAccess.getStarSchemaConfig().getMeasuresByName(querySortConstraint.getDimensionName()); if (measure.isPresent()) { orderByElement.addOrderByConstraint(measure.get(), querySortConstraint.getOrderByDirection()); } else { LOG.warn("Dimension or measure named " + querySortConstraint.getDimensionName() + " does not exist."); } } } if (orderByElement.orderByConstraint.isEmpty()) { return Optional.absent(); } return Optional.of(orderByElement); } private  OrderByElement(SqlQueryBuilderAccess queryBuilderAccess); static Optional<OrderByElement> createOrderByElement(final SqlQueryBuilderAccess queryBuilderAccess); StringBuilder getSqlString(); @Override Collection<? extends SqlTable> getSqlTables();  }### Answer:
@Test public void testCreateOrderByElementAbsent() throws Exception { new Expectations() { { queryBuilderAccess.getQueryParameter(); result = queryParameter; } }; Optional<OrderByElement> orderByElement = OrderByElement.createOrderByElement(queryBuilderAccess); assertFalse(orderByElement.isPresent()); }