Class tags are written when the class isn't known from the Java class definitions. Eg, if you have a field that is java.util.List (an interface), YamlBeans can't know what the concrete type of that object is, and so has to write class tags. If your field is
ArrayList then the class tag isn't written when the object is an ArrayList. However, if the object is a subclass of ArrayList, then the class tag must be written because the type doesn't match the class definition.