Just have the Entity assign itself an id.
See https://github.com/oharaandrew314/Gryd_Engine/blob/master/src/engine/models/entities/Entity.java#L13-19