public class BikeLogsumSegment {
private final int segmentId;
public BikeLogsumSegment(boolean isFemale, boolean mandatory, boolean inbound) {
segmentId = formSegmentId(isFemale,mandatory,inbound);
}
<BUG>private int formSegmentId(boolean isFemale, boolean mandatory, boolean inbound) {
return (isFemale ? 1 : 0) +
(mandatory ? 2 : 0) +
((mandatory && inbound) ? 2 : 0); //this last one is 2 not 4 because mandatory is a requirement</BUG>
}

public class BikeLogsumSegment {
private final int segmentId;
public BikeLogsumSegment(boolean isFemale, boolean mandatory, boolean inbound) {
segmentId = formSegmentId(isFemale,mandatory,inbound);
}
private int formSegmentId(boolean isFemale, boolean mandatory, boolean inbound) {
return 0; //only one segment now, but leaving in this structure in case it is needed in the future
}
