TestHelper.assertEqualArrays(segmentBytes2, segmentData.getSegment(segmentMarker, 1));
}
public void testRemoveSegmentOccurrence() throws Exception
{
JpegSegmentData segmentData = new JpegSegmentData();
byte segmentMarker = (byte)12;
byte[] segmentBytes1 = new byte[] { 1,2,3 };
byte[] segmentBytes2 = new byte[] { 3,2,1 };
segmentData.addSegment(segmentMarker, segmentBytes1);
segmentData.addSegment(segmentMarker, segmentBytes2);
assertEquals(2, segmentData.getSegmentCount(segmentMarker));
TestHelper.assertEqualArrays(segmentBytes1, segmentData.getSegment(segmentMarker, 0));
segmentData.removeSegmentOccurrence(segmentMarker, 0);
TestHelper.assertEqualArrays(segmentBytes2, segmentData.getSegment(segmentMarker, 0));
}