@Test void reverseModifiable() { List<String> list = this.tool.getLinkedList(); list.add("one"); list.add("two"); list.add("three"); assertTrue(this.tool.reverseModifiable(list), "Failed to reverse list"); assertEquals("three", list.get(0), "List wasn't properly reversed"); assertEquals("two", list.get(1), "List wasn't properly reversed"); assertEquals("one", list.get(2), "List wasn't properly reversed"); List<String> readonly = this.tool.unmodifiable(list); assertFalse(this.tool.reverseModifiable(readonly), "Unmodifiable list wrongly reversed"); assertEquals("three", list.get(0), "Unmodifiable list was changed"); assertFalse(this.tool.reverseModifiable(null), "Reversed a null list?"); }
public <E> boolean reverseModifiable(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }
CollectionTool extends org.apache.velocity.tools.generic.CollectionTool { public <E> boolean reverseModifiable(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } } }
CollectionTool extends org.apache.velocity.tools.generic.CollectionTool { public <E> boolean reverseModifiable(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }  }
CollectionTool extends org.apache.velocity.tools.generic.CollectionTool { public <E> boolean reverseModifiable(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }  List<E> getArrayList(); List<E> getLinkedList(); Map<K, V> getMap(); SortedMap<K, V> getSortedMap(); Map<K, V> getOrderedMap(); Set<E> getSet(); SortedSet<E> getSortedSet(); Set<E> getOrderedSet(); Queue<E> getQueue(); BlockingQueue<E> getBlockingQueue(); Queue<E> getPriorityQueue(); List<E> unmodifiable(List<E> input); Map<K, V> unmodifiable(Map<K, V> input); Set<E> unmodifiable(Set<E> input); Collection<E> unmodifiable(Collection<E> input); Collection<E> union(Collection<E> a, Collection<E> b); Collection<E> intersection(Collection<E> a, Collection<E> b); Collection<E> disjunction(Collection<E> a, Collection<E> b); boolean reverseModifiable(List<E> input); boolean sortModifiable(List<E> input); }
CollectionTool extends org.apache.velocity.tools.generic.CollectionTool { public <E> boolean reverseModifiable(List<E> input) { if (input == null) { return false; } try { Collections.reverse(input); return true; } catch (UnsupportedOperationException ex) { return false; } }  List<E> getArrayList(); List<E> getLinkedList(); Map<K, V> getMap(); SortedMap<K, V> getSortedMap(); Map<K, V> getOrderedMap(); Set<E> getSet(); SortedSet<E> getSortedSet(); Set<E> getOrderedSet(); Queue<E> getQueue(); BlockingQueue<E> getBlockingQueue(); Queue<E> getPriorityQueue(); List<E> unmodifiable(List<E> input); Map<K, V> unmodifiable(Map<K, V> input); Set<E> unmodifiable(Set<E> input); Collection<E> unmodifiable(Collection<E> input); Collection<E> union(Collection<E> a, Collection<E> b); Collection<E> intersection(Collection<E> a, Collection<E> b); Collection<E> disjunction(Collection<E> a, Collection<E> b); boolean reverseModifiable(List<E> input); boolean sortModifiable(List<E> input);  }