@Test public void testNullSort() { final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class, () -> groupingDefinitionDependencySort.sort(null)); assertEquals("Set of Type Definitions cannot be NULL!", ex.getMessage()); }
public List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions) { if (groupingDefinitions == null) { throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!"); } final List<Node> sortedNodes = TopologicalSort.sort(groupingDefinitionsToNodes(groupingDefinitions)); final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { NodeWrappedType nodeWrappedType = (NodeWrappedType) node; resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType()); } return resultGroupingDefinitions; }
GroupingDefinitionDependencySort { public List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions) { if (groupingDefinitions == null) { throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!"); } final List<Node> sortedNodes = TopologicalSort.sort(groupingDefinitionsToNodes(groupingDefinitions)); final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { NodeWrappedType nodeWrappedType = (NodeWrappedType) node; resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType()); } return resultGroupingDefinitions; } }
GroupingDefinitionDependencySort { public List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions) { if (groupingDefinitions == null) { throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!"); } final List<Node> sortedNodes = TopologicalSort.sort(groupingDefinitionsToNodes(groupingDefinitions)); final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { NodeWrappedType nodeWrappedType = (NodeWrappedType) node; resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType()); } return resultGroupingDefinitions; }  }
GroupingDefinitionDependencySort { public List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions) { if (groupingDefinitions == null) { throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!"); } final List<Node> sortedNodes = TopologicalSort.sort(groupingDefinitionsToNodes(groupingDefinitions)); final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { NodeWrappedType nodeWrappedType = (NodeWrappedType) node; resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType()); } return resultGroupingDefinitions; }  List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions); }
GroupingDefinitionDependencySort { public List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions) { if (groupingDefinitions == null) { throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!"); } final List<Node> sortedNodes = TopologicalSort.sort(groupingDefinitionsToNodes(groupingDefinitions)); final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>(sortedNodes.size()); for (Node node : sortedNodes) { NodeWrappedType nodeWrappedType = (NodeWrappedType) node; resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType()); } return resultGroupingDefinitions; }  List<GroupingDefinition> sort(final Collection<? extends GroupingDefinition> groupingDefinitions);  }