RootsOfUnity implements Serializable { public synchronized double getReal(int k) throws MathIllegalStateException, MathIllegalArgumentException { if (omegaCount == 0) { throw new MathIllegalStateException( LocalizedFormats.ROOTS_OF_UNITY_NOT_COMPUTED_YET); } if ((k < 0) || (k >= omegaCount)) { throw new OutOfRangeException( LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX, Integer.valueOf(k), Integer.valueOf(0), Integer.valueOf(omegaCount - 1)); } return omegaReal[k]; } RootsOfUnity(); synchronized boolean isCounterClockWise(); synchronized void computeRoots(int n); synchronized double getReal(int k); synchronized double getImaginary(int k); synchronized int getNumberOfRoots();  }
@Test(expected = MathIllegalStateException.class) public void testMathIllegalState1() { final RootsOfUnity roots = new RootsOfUnity(); roots.getReal(0); }