public TRichStruct setRichStruct(TRichStruct richStruct) throws WrongColor, UnexpectedException {
if (richStruct.innerStruct.color.value() == Color.red.value()) {
Color translatedColor = Color.from_int(richStruct.innerStruct.color.value());
throw new WrongColor(translatedColor, Color.green);
} else if (richStruct.longField == 0) {
throw new UnexpectedException("Expected richStruct.longField != 0");
}
return richStruct;
}