@Test
void testNoClassHintsForCollections() {
JsonParser.Defaults.classMetadataName = "class";
JsonSerializer.Defaults.classMetadataName = "class";
JsonParsers.forEachParser(jsonParser -> {
Hero superman = creator.createSuperman();
String json = new JsonSerializer()
.include("powers")
.include("powers.class")
.withSerializer("powers.class", new SimpleClassnameTransformer())
.exclude("*.class")
.serialize(superman);
int count = StringUtil.count(json, "***");
assertEquals(4, count);
json = StringUtil.remove(json, "***");
Hero jsonSuperMan = jsonParser
.map("lair", SecretLair.class)
.map("secretIdentity", SecretIdentity.class)
.parse(json, Hero.class);
assertEquals("Fortress of Solitude", jsonSuperMan.getLair().getName());
assertHeroHasSuperPowers(jsonSuperMan);
});
}