write Core.getSegment unit tests