### Question:
ScenarioMarketDataBox implements ImmutableBean, MarketDataBox<T>, Serializable { @Override public T getValue(int scenarioIndex) { ArgChecker.inRange(scenarioIndex, 0, value.getScenarioCount(), "scenarioIndex"); return value.get(scenarioIndex); } private  ScenarioMarketDataBox(
      ScenarioArray<T> value); static ScenarioMarketDataBox<T> of(ScenarioArray<T> value); @SafeVarargs static ScenarioMarketDataBox<T> of(T... values); static ScenarioMarketDataBox<T> of(List<T> values); @Override T getSingleValue(); @Override ScenarioArray<T> getScenarioValue(); @Override T getValue(int scenarioIndex); @Override boolean isSingleValue(); @Override int getScenarioCount(); @Override Class<?> getMarketDataType(); @Override MarketDataBox<R> map(Function<T, R> fn); @Override MarketDataBox<R> mapWithIndex(int scenarioCount, ObjIntFunction<T, R> fn); @Override MarketDataBox<R> combineWith(MarketDataBox<U> other, BiFunction<T, U, R> fn); @Override Stream<T> stream(); @SuppressWarnings("rawtypes") static ScenarioMarketDataBox.Meta meta(); @SuppressWarnings("unchecked") static ScenarioMarketDataBox.Meta<R> metaScenarioMarketDataBox(Class<R> cls); @SuppressWarnings("unchecked") @Override ScenarioMarketDataBox.Meta<T> metaBean(); ScenarioArray<T> getValue(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void getValue() { MarketDataBox<Integer> box = MarketDataBox.ofScenarioValues(27, 28, 29); assertThat(box.getValue(0)).isEqualTo(27); assertThat(box.getValue(1)).isEqualTo(28); assertThat(box.getValue(2)).isEqualTo(29); assertThatIllegalArgumentException() .isThrownBy(() -> box.getValue(-1)) .withMessage("Expected 0 <= 'scenarioIndex' < 3, but found -1"); assertThatIllegalArgumentException() .isThrownBy(() -> box.getValue(3)) .withMessage("Expected 0 <= 'scenarioIndex' < 3, but found 3"); }