public class BufferExample {
	public static void main(String[] args) {
		Buffer b = new Buffer();
		Thread c = new Consumer(b);
		c.start();
		try {
			for (int i = 1; i <= 7; i++)
				b.put(i);
		} catch (InterruptedException e) {
			System.out.println("Producer interrupted!");
		}
		c.interrupt();

		try {
			c.join();
		} catch (InterruptedException e) {
			System.out.println("Interrupted while waiting for consumer");
		}
	}
}
