question: @ Override public QueryTemplatePacket and ( QueryTemplatePacket template ) { LinkedList < QueryTemplatePacket > optimizedPackets = new LinkedList < QueryTemplatePacket > ( ) ; for ( QueryTemplatePacket packet : getPackets ( ) ) { QueryTemplatePacket result = new QueryTemplatePacket ( packet ) ; result . intersectRanges ( template ) ; result . intersectUids ( template ) ; if ( ! result . isAlwaysEmpty ( ) ) optimizedPackets . add ( result ) ; } setPackets ( optimizedPackets ) ; if ( optimizedPackets . isEmpty ( ) ) setAlwaysEmpty ( true ) ; return this ; }
target:  Merge given templates into one template. for example: x=3 and (y=5 or z=8) ==> (x=3 and y=5) or (x=3 and z=8)