Aufgabe Generics

Ich muss folgende Aufgabe möglichst gut und ordentlich lösen:

http://jeebone.je.funpic.de/java/6.JPG

das hab ich bisher folgendermaßen gemacht:


public class Hole<T>
{
	
	private ArrayList<T> objects = new ArrayList<T>();
	private int depth;
	private boolean isBlack = false;
	
	public static void main(String[] args)
	{
		Hole<String> hole = new Hole<String>(1);
		hole.dump("FFG");
		System.out.print(hole.get());
	}
	
	Hole(int n) throws RuntimeException
	{
		if(n <= 0)
			throw new RuntimeException();
		this.depth = n;
	}
	
	public int depth()
	{
		if(this.isBlack)
			return Integer.MAX_VALUE;
		return this.depth;
	}
	
	public void dump(T x)
	{
		if(objects.size() < depth || this.isBlack())
			objects.add(x);
	}
	
	public boolean isEmpty()
	{
		if(objects.size() == 0 || this.isBlack)
			return true;
		return false;
	}
	
	public int size()
	{
		if(this.isBlack)
			return Integer.MAX_VALUE;
		return objects.size();
	}
	
	// ältestes zurückgeben und löschen, so interpretiere ich das
	public T get()
	{
		if(this.size() > 0 && !this.isBlack)
			return objects.remove(0);
		return null;
	}
	
	public void deepen(int n) throws RuntimeException
	{
		if(n <= 0)
			throw new RuntimeException();
		this.depth += n;
	}
	
	public void dumpInto(Hole<T> that) throws RuntimeException
	{
		if(this.isBlack() && !that.isBlack())
			throw new RuntimeException();
		while(this.size() > 0)
			that.dump(this.get());
	}
	
	public void black()
	{
		this.isBlack = true;
	}
	
	public boolean isBlack()
	{
		return this.isBlack;
	}
	
}```


da ich aber noch Anfänger bin, wird das sicher nicht perfekt sein, könntet ihr mir sagen, wo da noch was zu verbessern ist, bzw wo was nicht so schön ist usw ...

für mich sieht das gut aus