### Question:
TimeSeries implements Serializable { public Tick getTick(int i) { int innerIndex = i - removedTicksCount; if (innerIndex < 0) { if (i < 0) { throw new IndexOutOfBoundsException(buildOutOfBoundsMessage(this, i)); } log.trace("Time series `{}` ({} ticks): tick {} already removed, use {}-th instead", name, ticks.size(), i, removedTicksCount); if (ticks.isEmpty()) { throw new IndexOutOfBoundsException(buildOutOfBoundsMessage(this, removedTicksCount)); } innerIndex = 0; } else if (innerIndex >= ticks.size()) { throw new IndexOutOfBoundsException(buildOutOfBoundsMessage(this, i)); } return ticks.get(innerIndex); } TimeSeries(String name, List<Tick> ticks);  TimeSeries(List<Tick> ticks);  TimeSeries(String name);  TimeSeries(); private  TimeSeries(String name, List<Tick> ticks, int beginIndex, int endIndex, boolean subSeries); String getName(); Tick getTick(int i); Tick getFirstTick(); Tick getLastTick(); int getTickCount(); int getBegin(); int getEnd(); String getSeriesPeriodDescription(); void setMaximumTickCount(int maximumTickCount); int getMaximumTickCount(); int getRemovedTicksCount(); void addTick(Tick tick); TimeSeries subseries(int beginIndex, int endIndex); TimeSeries subseries(int beginIndex, Period duration); List<TimeSeries> split(int nbTicks); List<TimeSeries> split(Period splitDuration, Period sliceDuration); List<TimeSeries> split(Period duration); TradingRecord run(Strategy strategy); TradingRecord run(Strategy strategy, OrderType orderType); TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount);  }### Answer:
@Test(expected = IndexOutOfBoundsException.class) public void getTickWithNegativeIndexShouldThrowException() { defaultSeries.getTick(-1); }
@Test(expected = IndexOutOfBoundsException.class) public void getTickWithIndexGreaterThanTickCountShouldThrowException() { defaultSeries.getTick(10); }