@Test public void testDispose() { Geometry.DEFAULT_POOL_SIZE = 1; Geometry geometry = new Geometry(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularPentagonsAvailable()); RegularPentagon pentagon = geometry.regularPentagon(); org.junit.Assert.assertEquals(0, geometry.getTotalRegularPentagonsAvailable()); pentagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularPentagonsAvailable()); pentagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularPentagonsAvailable()); pentagon = geometry.regularPentagon(); org.junit.Assert.assertEquals(0, geometry.getTotalRegularPentagonsAvailable()); pentagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularPentagonsAvailable()); }
@Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); }
RegularPentagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } }
RegularPentagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularPentagon(float centerX, float centerY, float radius);  RegularPentagon(Geometry geometry); }
RegularPentagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularPentagon(float centerX, float centerY, float radius);  RegularPentagon(Geometry geometry); @Override void dispose(); }
RegularPentagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularPentagon(float centerX, float centerY, float radius);  RegularPentagon(Geometry geometry); @Override void dispose(); static final float ROTATION_SYMMETRY; }