Homework 23: Programmatic Tests
Submit this homework using Gradescope. You can type up your answers, or write legibly and scan them. Do not attempt to submit a paper copy in class, as it will not be accepted.
Write JUnit-style test methods for each of the following (one method per test, please) (1 point each):
Collections.rotate
correctly rotates anArrayList
with a distance of zeroCollections.rotate
correctly rotates anArrayList
with a distance of oneArrayList.subList
can correctly return a sublist containing just the last element of the list
The ArrayList
instance you use in your tests should be an ascending list of the first thousand even Integer
s, starting from 0.