-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Milestone
Description
Currently, it is not possible to order children without first removing all children and then adding them back in order. E.g:
var children = new ArrayList<>(testDescriptor.getChildren());
Collections.shuffle(children);
children.forEach(testDescriptor::removeChild);
children.forEach(testDescriptor::addChild);By adding orderChildren(UnaryOperator<List<TestDescriptor>> orderer) would become possible to write:
testDescriptor.orderChildren(children -> {
Collections.shuffle(children);
return children;
});I've made #4289 to explore this solution.
And I found two items worth discussing:
TestDescriptoris an interface, adding a method requires a sensible default. What should that default be?- Should that default implementation be functional, because
TestDescriptoris an interface a default implementation must still useremoveChildandaddChild. Is it necessary to add a more optimized implementation inAbstractTestDescriptor?