QueryTaskUtils { public static Set<String> getExpandedQueryPropertyNames(ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } return getExpandedQueryPropertyNames(description.propertyDescriptions, MAX_NEST_LEVEL_EXPAND_PROPERTY); } private  QueryTaskUtils(); static void processQueryResults(ServiceHost host,
            List<ServiceDocumentQueryResult> dataSources,
            boolean isAscOrder, EnumSet<QueryOption> queryOptions,
            NodeGroupBroadcastResponse nodeGroupResponse, ServiceDocumentQueryResult result,
            BiConsumer<ServiceDocumentQueryResult, Throwable> onCompletion); static void mergeQueryResults(
            List<ServiceDocumentQueryResult> dataSources, boolean isAscOrder, ServiceDocumentQueryResult result); static void mergeQueryResults(
            List<ServiceDocumentQueryResult> dataSources,
            boolean isAscOrder, EnumSet<QueryOption> queryOptions, ServiceDocumentQueryResult result); static void expandLinks(ServiceHost host, QueryTask task, Operation op); static Set<String> getExpandedQueryPropertyNames(ServiceDocumentDescription description); static void failTask(Operation get, Throwable ex);  }
@Test public void testGetQueryPropertyNames() throws Throwable { ServiceDocumentDescription desc = Builder.create().buildDescription( ExampleServiceState.class); Set<String> queryPropertyNames = QueryTaskUtils.getExpandedQueryPropertyNames(desc); Set<String> expectedPropertyNames = new HashSet<>(); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_COUNTER); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_SORTED_COUNTER); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_NAME); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_ID); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_REQUIRED); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_KEY_VALUES); expectedPropertyNames.add(ExampleServiceState.FIELD_NAME_IS_FROM_MIGRATION); expectedPropertyNames.add("tags.item"); assertEquals(expectedPropertyNames, queryPropertyNames); }
@Test public void testGetMultiLevelNestedQueryPropertyNames() throws Throwable { ServiceDocumentDescription desc = Builder.create().buildDescription( ComplexServiceState.class); Set<String> queryPropertyNames = QueryTaskUtils.getExpandedQueryPropertyNames(desc); Set<String> expectedPropertyNames = new HashSet<>(); expectedPropertyNames.add("name"); expectedPropertyNames.add("innerServices.item.nameInner"); expectedPropertyNames.add("singleInnerService.nameInner"); expectedPropertyNames.add("singleInnerService.singleInnerService.nameSecondInner"); assertEquals(expectedPropertyNames, queryPropertyNames); }