Problem with this constructor
public Collection() { super(Collection.class); }
Whether the superclass constructor is awaiting Class<E> , but the Collection.class class literal is Class<Collection> . These types are incompatible because E may be a Collection , a Document or anything else that can extend Collection .
Any class, such as Document , that extends Collection , must provide its own class, so it will call another Collection constructor that takes the value of Class<E> , so I don't think the Collection() constructor has any use. I would delete it.
Also, on the top line for E you are using the raw form of the classes themselves that you are trying to generalize. Use
public abstract class BaseEntity<E extends BaseEntity<E>> {
and
public class Collection<E extends Collection<E>> extends BaseEntity<E> {
The Collection type is generic, so you must specify a generic type parameter that matches the argument to the Collection constructor.
Collection<Document> c = new Collection<Document>(Document.class); c = c.getNewInstance();
The document itself is not shared, so this code is still beautiful:
Document d = new Document(); d = d.getNewInstance();
Document must be provided as a type argument for Collection even when directly creating a Document , since a Document is a Collection<Document> .
Collection<Document> cd = new Document(); cd = cd.getNewInstance();