setClass("Foo", representation(bar = "character"))
a <- new("Foo", bar = letters)
setClass("Foo", representation(bar = "character", star = "numeric", flag = "logical"))
stopifnot(is.character(validObject(a, test = TRUE)))
setClass("Foo", representation(bar = "POSIXt"))
stopifnot(is.character(validObject(a, test = TRUE)))
setClass("Foo", contains = "character", representation(bar = "character"))
stopifnot(is.character(validObject(a, test = TRUE)))
setClass("Foo", contains = "lm", representation(bar = "character"))
stopifnot(is.character(validObject(a, test = TRUE)))

 setClass("myEnv", contains = "environment", representation(bar = "character"))
mvv = new("myEnv", new.env(), bar = "test")


setClass("c1", representation(x="numeric"))
setClass("c2", representation(y = "numeric", xx = "c1"))
xx <- new("c2", y = 1, xx = new("c1", x = 2))
removeClass("c1")
stopifnot(is.character(validObject(xx, test = TRUE)))
