@Test
	public void test_removeMolecule_shouldReturnResourcesToWorldOnlyAfterAnUpdate()
	{
		// Create a fresh world. Tell it not to create seed molecules as this complicates our tests.
		world = new World(VALID_WIDTH, VALID_HEIGHT);
		world.shouldCreateSeed = false;
		
		// Create a "dead" molecule with a well-known composition.
		IMutableResourceCollection composition = new ResourceCollection();
		final WorldResource RESOURCE_TYPE = WorldResource.getRandomSpecificResource();
		final int RESOURCE_AMOUNT = 10;
		composition.depositResources(RESOURCE_TYPE, RESOURCE_AMOUNT);
		Molecule molecule = mock(Molecule.class);
		when(molecule.getComposition()).thenReturn(composition);
		when(molecule.getRemainingEnergy()).thenReturn(IReadableMolecule.MOLECULE_ENERGY_DEPLETED);
		
		// Record all resources in the world at a random position.
		int x = getValidWorldCoordinate();
		int y = getValidWorldCoordinate();
		IMutableResourceCollection worldResourcesAtXY = world.getMutableResourceCollectionAtPosition(x,y);
		IMutableResourceCollection resourcesBefore = new ResourceCollection();
		for (WorldResource r : WorldResource.values())
		{
			if (r != WorldResource.Unspecified && worldResourcesAtXY.getResourceCount(r) > 0)
			{
				resourcesBefore.depositResources(r, worldResourcesAtXY.getResourceCount(r));
			}
		}
		
		// Add our new molecule at that position.
		world.addMoleculeAtPosition(x, y, molecule);
		
		// Remove the molecule and ensure nothing was taken from the world.
		world.removeMolecule(molecule);
		IReadableResourceCollection resourcesAfterRemoval = world.getMutableResourceCollectionAtPosition(x, y);
		for (WorldResource r : WorldResource.values())
		{
			if (r == WorldResource.Unspecified)
			{
				continue;
			}
			else
			{
				assertEquals(
						"Some resources were mistakenly added to / taken from the system. This should not happen when a molecule is simply removed from the world.",
						resourcesBefore.getResourceCount(r),
						resourcesAfterRemoval.getResourceCount(r));
			}
		}
		
		// Update the world, and ensure that the molecule was recycled.
		final SimulationTime ONE_TICK = new SimulationTime(1); 
		world.update(ONE_TICK);
		IReadableResourceCollection resourcesAfterUpdate = world.getMutableResourceCollectionAtPosition(x, y);
		for (WorldResource r : WorldResource.values())
		{
			if (r == WorldResource.Unspecified)
			{
				continue;
			}
			// If the resource we're looking at was the type to be recycled, ensure it was recycled.
			else if (r == RESOURCE_TYPE)
			{
				assertEquals(
						"Molecule's resources were not recycled.",
						resourcesBefore.getResourceCount(r) + RESOURCE_AMOUNT,
						resourcesAfterUpdate.getResourceCount(r));
			}
			// Otherwise, ensure no change.
			else
			{
				assertEquals(
						"Some resources were mistakenly added to / taken from the system.",
						resourcesBefore.getResourceCount(r),
						resourcesAfterUpdate.getResourceCount(r));
			}
		}
	}