@Test @SuppressWarnings("unchecked") public void sortDoesNothingWhenTheSortParametersAreEmpty() { GraphTraversal<Vertex, Vertex> traversal = mock(GraphTraversal.class); List<SortParameter> sortParameters = Lists.newArrayList(); instance.sort(traversal, sortParameters); verifyZeroInteractions(traversal); }
public void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters) { if (sortParameters.isEmpty()) { return; } List<SortTraversal> traversals = collectTraversals(sortParameters); if (traversals.isEmpty()) { return; } searchResult.order(); for (SortTraversal sortTraversal : traversals) { for (GraphTraversal<Object, Object> traversal : sortTraversal.traversals) { searchResult.by(traversal, sortTraversal.order); } } }
SortDescription { public void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters) { if (sortParameters.isEmpty()) { return; } List<SortTraversal> traversals = collectTraversals(sortParameters); if (traversals.isEmpty()) { return; } searchResult.order(); for (SortTraversal sortTraversal : traversals) { for (GraphTraversal<Object, Object> traversal : sortTraversal.traversals) { searchResult.by(traversal, sortTraversal.order); } } } }
SortDescription { public void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters) { if (sortParameters.isEmpty()) { return; } List<SortTraversal> traversals = collectTraversals(sortParameters); if (traversals.isEmpty()) { return; } searchResult.order(); for (SortTraversal sortTraversal : traversals) { for (GraphTraversal<Object, Object> traversal : sortTraversal.traversals) { searchResult.by(traversal, sortTraversal.order); } } } SortDescription(List<SortFieldDescription> sortFieldDescriptions); }
SortDescription { public void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters) { if (sortParameters.isEmpty()) { return; } List<SortTraversal> traversals = collectTraversals(sortParameters); if (traversals.isEmpty()) { return; } searchResult.order(); for (SortTraversal sortTraversal : traversals) { for (GraphTraversal<Object, Object> traversal : sortTraversal.traversals) { searchResult.by(traversal, sortTraversal.order); } } } SortDescription(List<SortFieldDescription> sortFieldDescriptions); void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters); }
SortDescription { public void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters) { if (sortParameters.isEmpty()) { return; } List<SortTraversal> traversals = collectTraversals(sortParameters); if (traversals.isEmpty()) { return; } searchResult.order(); for (SortTraversal sortTraversal : traversals) { for (GraphTraversal<Object, Object> traversal : sortTraversal.traversals) { searchResult.by(traversal, sortTraversal.order); } } } SortDescription(List<SortFieldDescription> sortFieldDescriptions); void sort(GraphTraversal<Vertex, Vertex> searchResult, List<SortParameter> sortParameters);  }