### Question:
DefaultStreamingStrategy implements StreamingStrategy { @Override public boolean requiresStreaming(Segment segment) { if (segment.isSampled() && null != segment.getTotalSize()) { return segment.getTotalSize().intValue() > maxSegmentSize; } return false; } DefaultStreamingStrategy();  DefaultStreamingStrategy(int maxSegmentSize); int getMaxSegmentSize(); @Override boolean requiresStreaming(Segment segment); @Override void streamSome(Entity entity, Emitter emitter);  }### Answer:
@Test public void testDefaultStreamingStrategyRequiresStreaming() { DefaultStreamingStrategy defaultStreamingStrategy = new DefaultStreamingStrategy(1); Segment smallSegment = new SegmentImpl(AWSXRay.getGlobalRecorder(), "small"); Assert.assertFalse(defaultStreamingStrategy.requiresStreaming(smallSegment)); Segment bigSegment = new SegmentImpl(AWSXRay.getGlobalRecorder(), "big"); bigSegment.addSubsegment(new SubsegmentImpl(AWSXRay.getGlobalRecorder(), "big_child", bigSegment)); bigSegment.addSubsegment(new SubsegmentImpl(AWSXRay.getGlobalRecorder(), "big_child", bigSegment)); Assert.assertTrue(defaultStreamingStrategy.requiresStreaming(bigSegment)); }
@Test public void testDefaultStreamingStrategyDoesNotRequireStreaming() { DefaultStreamingStrategy defaultStreamingStrategy = new DefaultStreamingStrategy(1); Segment smallSegment = new SegmentImpl(AWSXRay.getGlobalRecorder(), "small"); Assert.assertFalse(defaultStreamingStrategy.requiresStreaming(smallSegment)); }