### Question:
MarkerSegmentedSampleSource extends MultichannelSampleProcessor implements MultichannelSegmentedSampleSource { @Override public int getSegmentCount() { return offsets.length; } protected  MarkerSegmentedSampleSource(MultichannelSampleSource source);  MarkerSegmentedSampleSource(MultichannelSampleSource source, StyledTagSet tagSet, List<String> markerStyleNames,
			double startTime, double segmentLength, ChannelSpace channelSpace);  MarkerSegmentedSampleSource(MultichannelSampleSource source,
			Double startMarkerSelection, Double endMarkerSelection,
			StyledTagSet tagSet, List<String> markerStyleNames,
			List<String> artifactStyleNames,
			double startTime, double length, ChannelSpace channelSpace);  MarkerSegmentedSampleSource(MultichannelSampleSource source, MarkerSegmentedSampleSourceDescriptor descriptor); @Override MarkerSegmentedSampleSourceDescriptor createDescriptor(); @Override double getSegmentTime(int segment); @Override void getSamples(int channel, double[] target, int signalOffset, int count, int arrayOffset); @Override int getSegmentCount(); int getSegmentLengthInSamples(); @Override int getDocumentChannelIndex(int channel); @Override int getChannelCount(); @Override int getSampleCount(int channel); @Override void getSegmentSamples(int channel, double[] target, int segment); @Override int getUnusableSegmentCount(); int getArtifactRejectedSegmentsCount(); @Override String getLabel(int channel); IChannelFunction getChannelFunction(int channel);  }### Answer:
@Test public void testGetSamplesWithZeroTags() { MarkerSegmentedSampleSource markerSampleSource = new MarkerSegmentedSampleSource( getSampleSource(), getTagSet(), getMarkerStyleNames(), 0.0, 1.0, null); assertEquals(0, markerSampleSource.getSegmentCount()); }
@Test public void testTwoTagsGrouped() { StyledTagSet tagSet = getTagSet(); tagSet.addTag(new Tag(averagedTagStyle, 1.0, 0.1)); tagSet.addTag(new Tag(averagedTagStyle, 2.0, 0.1)); tagSet.addTag(new Tag(otherTagStyle, 1.0, 1.0)); tagSet.addTag(new Tag(otherTagStyle, 3.0, 1.0)); List<String> markerStyleNames = new ArrayList<String>(); markerStyleNames.add(AVERAGED_TAG_NAME); markerStyleNames.add(AVERAGED_TAG_NAME_2); MarkerSegmentedSampleSource markerSampleSource = new MarkerSegmentedSampleSource( getSampleSource(), null, null, tagSet, markerStyleNames, new ArrayList<String>(), 0.0, 1.0, null); assertEquals(2, markerSampleSource.getSegmentCount()); }