@Test public void testSingleton() { try { assertTrue(PrimeTable.getPrimeTable(limit) == primeTable); PrimeTable tempTable = PrimeTable.getPrimeTable(limit); assertTrue(primeTable.equals(tempTable)); } catch (BadLimitException e) { System.out.println(e.getMessage()); System.out.println(e.getStackTrace()); } }
@Before public void primeTableInit() { limit = 1; try { primeTable = PrimeTable.getPrimeTable(limit); table = primeTable.getTable(); } catch (BadLimitException e) { System.out.println(e.getMessage()); System.out.println(e.getStackTrace()); } }