Tries to cast the Layer to T, throws ClassCastException if it's another type.
the casted Layer, null if another type
the layer id used to look up a layer
the generic attribute of a Layer