@Test public void shouldReturnAnOrderedListOfChangeScripts() throws Exception { ChangeScript one = new ChangeScript(1); ChangeScript two = new ChangeScript(2); ChangeScript three = new ChangeScript(3); ChangeScript four = new ChangeScript(4); ChangeScriptRepository repository = new ChangeScriptRepository(Arrays.asList( three, two, four, one )); List<ChangeScript> list = repository.getOrderedListOfDoChangeScripts(); assertThat(4, equalTo(list.size())); assertSame(one, list.get(0)); assertSame(two, list.get(1)); assertSame(three, list.get(2)); assertSame(four, list.get(3)); }
public List<ChangeScript> getOrderedListOfDoChangeScripts() { return Collections.unmodifiableList(scripts); }
ChangeScriptRepository implements AvailableChangeScriptsProvider { public List<ChangeScript> getOrderedListOfDoChangeScripts() { return Collections.unmodifiableList(scripts); } }
ChangeScriptRepository implements AvailableChangeScriptsProvider { public List<ChangeScript> getOrderedListOfDoChangeScripts() { return Collections.unmodifiableList(scripts); } @SuppressWarnings("unchecked")  ChangeScriptRepository(List<ChangeScript> scripts); }
ChangeScriptRepository implements AvailableChangeScriptsProvider { public List<ChangeScript> getOrderedListOfDoChangeScripts() { return Collections.unmodifiableList(scripts); } @SuppressWarnings("unchecked")  ChangeScriptRepository(List<ChangeScript> scripts); List<ChangeScript> getOrderedListOfDoChangeScripts(); List<ChangeScript> getAvailableChangeScripts(); }
ChangeScriptRepository implements AvailableChangeScriptsProvider { public List<ChangeScript> getOrderedListOfDoChangeScripts() { return Collections.unmodifiableList(scripts); } @SuppressWarnings("unchecked")  ChangeScriptRepository(List<ChangeScript> scripts); List<ChangeScript> getOrderedListOfDoChangeScripts(); List<ChangeScript> getAvailableChangeScripts();  }