Make sure you’re casting the container first, and then calling getID().
((Worker) this.getContainer())
.getID()
;
Or add an abstract method, so you would not need to cast it at all.
public abstract class Container {
public abstract Object getID();
}