### Question:
SabrFormulaData implements SmileModelData, ImmutableBean, Serializable { @Override public boolean isAllowed(int index, double value) { switch (index) { case 0: case 1: case 3: return value >= 0; case 2: return value >= -1 && value <= 1; default: throw new IllegalArgumentException("index " + index + " outside range"); } } private  SabrFormulaData(
      DoubleArray parameters); static SabrFormulaData of(double alpha, double beta, double rho, double nu); static SabrFormulaData of(double[] parameters); double getAlpha(); double getBeta(); double getRho(); double getNu(); SabrFormulaData withAlpha(double alpha); SabrFormulaData withBeta(double beta); SabrFormulaData withRho(double rho); SabrFormulaData withNu(double nu); @Override int getNumberOfParameters(); @Override double getParameter(int index); @Override boolean isAllowed(int index, double value); @Override SabrFormulaData with(int index, double value); static TypedMetaBean<SabrFormulaData> meta(); @Override TypedMetaBean<SabrFormulaData> metaBean(); DoubleArray getParameters(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testWrongIndex() { assertThatIllegalArgumentException() .isThrownBy(() -> DATA.isAllowed(-1, ALPHA)); }