<BUG>if (ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(0) instanceof Rational && ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(1) instanceof Rational) {</BUG><CONTEXT>ycbcr.setYCbCrPositioning(yCbCrPositioning);photometricInterpretation.setYCbCr(ycbcr);if (ifd.getMetadata() != null && ifd.getMetadata().containsTagId(TiffTags.getTagId("ReferenceBlackWhite"))) {BasicImageInformationType.BasicImageCharacteristics.PhotometricInterpretation.ReferenceBlackWhite referenceBlackWhite = new BasicImageInformationType.BasicImageCharacteristics.PhotometricInterpretation.ReferenceBlackWhite();try {<extra_id_0>Rational headroom = (Rational) ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(0);Rational footroom = (Rational) ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(1);BasicImageInformationType.BasicImageCharacteristics.PhotometricInterpretation.ReferenceBlackWhite.Component component = createComponentFromReferences(headroom, footroom);</CONTEXT>
if (ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(0) instanceof Rational && ifd.getMetadata().get("ReferenceBlackWhite").getValue().size() > 0 && ifd.getMetadata().get("ReferenceBlackWhite").getValue().get(1) instanceof Rational) {