/** * Order the tests in <code>target</code>. * * @throws InvalidOrderingException if ordering does something invalid (like remove or add * children) */ public void apply(Object target) throws InvalidOrderingException { if (target instanceof Orderable) { Orderable orderable = (Orderable) target; orderable.order(this); } } }
/** * Order the tests in <code>target</code> using this ordering. * * @throws InvalidOrderingException if ordering does something invalid (like remove or add * children) */ public void apply(Object target) throws InvalidOrderingException { /* * Note that some subclasses of Ordering override apply(). The Sorter * subclass of Ordering overrides apply() to apply the sort (this is * done because sorting is more efficient than ordering). */ if (target instanceof Orderable) { Orderable orderable = (Orderable) target; orderable.order(new Orderer(this)); } }
/** * {@inheritDoc} * * @since 4.13 */ public void order(Orderer orderer) throws InvalidOrderingException { if (getTest() instanceof Orderable) { Orderable adapter = (Orderable) getTest(); adapter.order(orderer); } }