public static HashSet<Ball> findCollisions(HashMap<Integer, Ball> balls, BufferedImage image, Color bgColor)
	{
		// Master collection of found collisions.
		// Note: HashSet is important here. It is possible for two balls to detect each other
		// and cancel collision() out when they're called twice. This way we only have unique
		// balls in the set.
		HashSet<Ball> collisions = new HashSet<Ball>();
		
		for(Ball ball : balls.values())
		{
			// A temporary list to store the current balls potential collisions.
			HashSet<Ball> tempList = proximityDetection(balls, ball, image, bgColor);
			Iterator<Ball> it = tempList.iterator();
			
			// Loop over the list checking if the balls are colliding.
			while(it.hasNext())
			{
				Ball tempBall = it.next();
				
				// If they're not colliding remove it from the list.
				// WARNING: short circuiting OR (ab)used here! If the check for null is after checkCollision you will get a null pointer exception!
				if(tempBall == null || !checkCollision(ball, tempBall))
					it.remove();
			}
			
			if(!tempList.isEmpty())
			{
				// The current ball isn't included in the list so we add it here.
				tempList.add(ball);
				
				// Add all the collisions to the master list.
				collisions.addAll(tempList);
			}
		}

		return collisions;
	}