Although reflection/introspection is a powerful workaround tool, we should avoid abusing it.
You could easily replace newInstance() w/ a switch/case block, where each “className” has a corresponding return new className();.
switch
case
return new className();