@Test public final void shouldReturnEmptyListIfTreeIsEmpty() throws Exception { given(tree.isEmpty()).willReturn(true); List<Entity> nodesList = entityTreeUtils.getSortedEntities(tree); Assert.assertTrue(nodesList.isEmpty()); }
public List<Entity> getSortedEntities(final EntityTree tree) { List<Entity> nodesList = Lists.newLinkedList(); if (tree.isEmpty()) { return nodesList; } return getSortedEntitiesFromNode(tree.getRoot()); }
EntityTreeUtilsService { public List<Entity> getSortedEntities(final EntityTree tree) { List<Entity> nodesList = Lists.newLinkedList(); if (tree.isEmpty()) { return nodesList; } return getSortedEntitiesFromNode(tree.getRoot()); } }
EntityTreeUtilsService { public List<Entity> getSortedEntities(final EntityTree tree) { List<Entity> nodesList = Lists.newLinkedList(); if (tree.isEmpty()) { return nodesList; } return getSortedEntitiesFromNode(tree.getRoot()); }  }
EntityTreeUtilsService { public List<Entity> getSortedEntities(final EntityTree tree) { List<Entity> nodesList = Lists.newLinkedList(); if (tree.isEmpty()) { return nodesList; } return getSortedEntitiesFromNode(tree.getRoot()); }  static EntityTree getDetachedEntityTree(final List<Entity> entities); List<Entity> getSortedEntities(final EntityTree tree); }
EntityTreeUtilsService { public List<Entity> getSortedEntities(final EntityTree tree) { List<Entity> nodesList = Lists.newLinkedList(); if (tree.isEmpty()) { return nodesList; } return getSortedEntitiesFromNode(tree.getRoot()); }  static EntityTree getDetachedEntityTree(final List<Entity> entities); List<Entity> getSortedEntities(final EntityTree tree);  }