@Synchronized
    Set<Segment> getSegments(String reader) {
        Map<Segment, Long> segments = assignedSegments.get(reader);
        if (segments == null) {
            return null;
        }
        return new HashSet<>(segments.keySet());
    }
@ Synchronized Set < Segment > getSegments ( String reader ) { Map < Segment , Long > segments = assignedSegments . get ( reader ) ; if ( segments == null ) { return null ; } return new HashSet < > ( segments . keySet ( ) ) ; }
Returns the list of segments assigned to the requested reader, or null if this reader does not exist.