question: private void insertAdobeMarkerSegment ( AdobeMarkerSegment newGuy ) { boolean hasJFIF = ( findMarkerSegment ( JFIFMarkerSegment . class , true ) != null ) ; int lastUnknown = findLastUnknownMarkerSegmentPosition ( ) ; if ( hasJFIF ) { markerSequence . add ( 1 , newGuy ) ; } else if ( lastUnknown != - 1 ) { markerSequence . add ( lastUnknown + 1 , newGuy ) ; } else { markerSequence . add ( 0 , newGuy ) ; } }
target:  Insert the given AdobeMarkerSegment into the marker sequence, as follows (we assume there is no Adobe segment yet): If there is a JFIF segment, then the new Adobe segment is inserted after it. If there is no JFIF segment, the new Adobe segment is inserted after the last Unknown segment, if there are any. If there are no Unknown segments, the new Adobe segment is inserted at the beginning of the sequence.