private static <T> T parse(AbstractPdb pdb, PdbByteReader reader, Class<T> requiredClass)
			throws PdbException, CancelledException {
		int dataTypeId = reader.parseUnsignedShortVal();
		try {
			IdMsParsable parsable = parse(pdb, reader, dataTypeId);
			if (requiredClass.isInstance(parsable)) {
				return requiredClass.cast(parsable);
			}
			PdbLog.logSerializationItemClassMismatch(parsable, requiredClass, dataTypeId);
		}
		catch (PdbException e) {
			PdbLog.logDeserializationFailure(reader, dataTypeId, e);
		}
		return requiredClass.cast(new BadMsType(pdb, dataTypeId));
	}
Deserialized data type ID and parsable indicated by the ID and returns the type
 required type expected.  Upon failure, message is logged and BadMsType is returned.
@param <T> the required type to be returned.  IMPORTANT:  T must only be one of:
 {@link AbstractMsType} or {@link MsTypeField} or something else in common with
 {@link BadMsType}, otherwise a Bad Cast Exception might occur.
@param pdb {@link AbstractPdb} that owns the Types to be parsed.
@param reader {@link PdbByteReader} from which to deserialize the data.
@param requiredClass the required type to be returned.
@return an instance of type T or type T version of BadMsType. IMPORTANT: See restriction
 on T.
@throws PdbException upon error parsing dataTypeId.
@throws CancelledException Upon user cancellation.
Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/TypeParser.java