Check type of object being written via writeObject(T obj) method; override PailtoString() method for nicer printout