SharedTable { public static Table<DefaultColumn<Double>, Double> getTable() { if (publicCopy == null) { publicCopy = createTable(); } else { publicCopy.setRowCount(0); publicCopy.setColumnCount(0); } publicCopy.addAll(table); publicCopy.setRowCount(table.getRowCount()); publicCopy.setColumnCount(table.getColumnCount()); for (int i = 0; i < table.getRowCount(); i++) { publicCopy.setRowHeader(i, table.getRowHeader(i)); } return publicCopy; } private  SharedTable(); static void add(final String label, final String header,
		final long value); static void add(final String label, final String header,
		final double value); static void add(final String label, final String header,
		final Double value); static Table<DefaultColumn<Double>, Double> getTable(); static boolean hasData(); static void reset(); static final Double EMPTY_CELL; }
@Test public void testGetTableCopyDataCleared() { final Table<DefaultColumn<Double>, Double> copy = SharedTable.getTable(); copy.appendRow(); copy.appendColumn(); copy.set(0, 0, 13.0); final Table<DefaultColumn<Double>, Double> copy2 = SharedTable.getTable(); assertEquals(0, copy2.size()); assertEquals(0, copy2.getColumnCount()); assertEquals(0, copy2.getRowCount()); }
@Test public void testGetTableCopyPersists() { final Table<?, ?> instance1 = SharedTable.getTable(); final Table<?, ?> instance2 = SharedTable.getTable(); assertSame(instance1, instance2); }