My own implementation of Java generic collections