add Example code to segment_test