Selector selector = builder.build();
Assert.assertNotNull(selector.getOrdering());
Assert.assertEquals(1, selector.getOrdering().length);
OrderBy orderBy = selector.getOrdering()[0];
Assert.assertEquals("AverageCpm", orderBy.getField());
Assert.assertEquals(SortOrder.ASCENDING, orderBy.getSortOrder());
builder.orderAscBy("AverageCpm").orderDescBy("AverageCpc");
selector = builder.build();
Assert.assertNotNull(selector.getOrdering());
Assert.assertEquals(2, selector.getOrdering().length);
orderBy = selector.getOrdering()[0];
Assert.assertEquals("AverageCpm", orderBy.getField());
Assert.assertEquals(SortOrder.ASCENDING, orderBy.getSortOrder());
orderBy = selector.getOrdering()[1];
Assert.assertEquals("AverageCpc", orderBy.getField());
Assert.assertEquals(SortOrder.DESCENDING, orderBy.getSortOrder());
selector = builder.removeOrderBy("AverageCpm").build();
Assert.assertNotNull(selector.getOrdering());
Assert.assertEquals(1, selector.getOrdering().length);
orderBy = selector.getOrdering()[0];
Assert.assertEquals("AverageCpc", orderBy.getField());
Assert.assertEquals(SortOrder.DESCENDING, orderBy.getSortOrder());
}