private <T> Integer applySystemQueryOptions(final EdmEntitySet entitySet, final List<T> data,
final FilterExpression filter, final InlineCount inlineCount, final OrderByExpression orderBy,
final String skipToken, final Integer skip, final Integer top) throws ODataException {
ODataContext context = getContext();
final int timingHandle = context.startRuntimeMeasurement(getClass().getSimpleName(), "applySystemQueryOptions");
if (filter != null) {
// Remove all elements the filter does not apply for.
// A for-each loop would not work with "remove", see Java documentation.
for (Iterator<T> iterator = data.iterator(); iterator.hasNext();) {