simplified ObjectClass creation
throwing IllegalStateException instead of UnexpectedValueException
fixed test according to modified Enum::toString()