@Test public void shouldAllowChangeScriptsThatStartFromZero() throws Exception { ChangeScript zero = new ChangeScript(0); ChangeScript four = new ChangeScript(4); ChangeScriptRepository repository = new ChangeScriptRepository(Arrays.asList( zero, four )); List<ChangeScript> list = repository.getOrderedListOfDoChangeScripts(); assertThat(2, equalTo(list.size())); assertSame(zero, list.get(0)); assertSame(four, list.get(1)); }
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();  }