@Override
public <T> T getField(SchemaId fieldId) throws FieldNotFoundException {
QName qname = mapping.get(fieldId);
if (qname == null) {
throw new FieldNotFoundException(fieldId);
}
// The cast to (T) is only needed for a bug in JDK's < 1.6u24
return (T)record.getField(qname);
}