RootsOfUnity implements Serializable { public synchronized int getNumberOfRoots() { return omegaCount; } RootsOfUnity(); synchronized boolean isCounterClockWise(); synchronized void computeRoots(int n); synchronized double getReal(int k); synchronized double getImaginary(int k); synchronized int getNumberOfRoots();  }
@Test public void testGetNumberOfRoots() { final RootsOfUnity roots = new RootsOfUnity(); Assert.assertEquals("", 0, roots.getNumberOfRoots()); roots.computeRoots(5); Assert.assertEquals("", 5, roots.getNumberOfRoots()); roots.computeRoots(-5); Assert.assertEquals("", 5, roots.getNumberOfRoots()); roots.computeRoots(6); Assert.assertEquals("", 6, roots.getNumberOfRoots()); }