// Path: ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/shard/RangeShardValue.java
// public class RangeShardValue {
// 
//     private Long begin;
//     private Long end;
// 
//     public RangeShardValue() {
//     }
// 
//     public RangeShardValue(Long begin, Long end) {
//         this.begin = begin;
//         this.end = end;
//     }
// 
//     public Long getBegin() {
//         return begin;
//     }
// 
//     public void setBegin(Long begin) {
//         this.begin = begin;
//     }
// 
//     public Long getEnd() {
//         return end;
//     }
// 
//     public void setEnd(Long end) {
//         this.end = end;
//     }
// 
//     @Override
//     public String toString() {
//         return "{" + "begin:" + begin + ",end:" + end + '}';
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(begin, end);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         RangeShardValue that = (RangeShardValue) o;
// 
//         if (begin != null ? !begin.equals(that.begin) : that.begin != null) return false;
//         return end != null ? end.equals(that.end) : that.end == null;
// 
//     }
// 
// }


import org.hellojavaer.ddal.core.utils.Assert;
import org.hellojavaer.ddal.ddr.shard.RangeShardValue;
import org.hellojavaer.ddal.ddr.shard.ShardRouteInfo;
import org.junit.Test;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
                                                                                       new RangeShardValue(2l, 7l));
        Map<ShardRouteInfo, List<RangeShardValue>> expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member_0", "user_0"), Arrays.asList(new RangeShardValue(2l, 3l)));
        expectedResult.put(new ShardRouteInfo("member_0", "user_1"), Arrays.asList(new RangeShardValue(4l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(null, 4L);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member", "user_0"), Arrays.asList(new RangeShardValue(2l, 3l)));
        expectedResult.put(new ShardRouteInfo("member", "user_1"), Arrays.asList(new RangeShardValue(4l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(8l, null);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member_0", "user"), Arrays.asList(new RangeShardValue(2l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(null, null);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member", "user"), Arrays.asList(new RangeShardValue(2l, 7l)));
        Assert.equals(map, expectedResult);
    }

    @Test
// Path: ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/shard/RangeShardValue.java
// public class RangeShardValue {
// 
//     private Long begin;
//     private Long end;
// 
//     public RangeShardValue() {
//     }
// 
//     public RangeShardValue(Long begin, Long end) {
//         this.begin = begin;
//         this.end = end;
//     }
// 
//     public Long getBegin() {
//         return begin;
//     }
// 
//     public void setBegin(Long begin) {
//         this.begin = begin;
//     }
// 
//     public Long getEnd() {
//         return end;
//     }
// 
//     public void setEnd(Long end) {
//         this.end = end;
//     }
// 
//     @Override
//     public String toString() {
//         return "{" + "begin:" + begin + ",end:" + end + '}';
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(begin, end);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         RangeShardValue that = (RangeShardValue) o;
// 
//         if (begin != null ? !begin.equals(that.begin) : that.begin != null) return false;
//         return end != null ? end.equals(that.end) : that.end == null;
// 
//     }
// 
// }


// Path: ddal-ddr/src/test/java/org/hellojavaer/ddal/ddr/shard/rule/DivideShardRouteRuleTest.java
import org.hellojavaer.ddal.core.utils.Assert;
import org.hellojavaer.ddal.ddr.shard.RangeShardValue;
import org.hellojavaer.ddal.ddr.shard.ShardRouteInfo;
import org.junit.Test;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

                                                                                       new RangeShardValue(2l, 7l));
        Map<ShardRouteInfo, List<RangeShardValue>> expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member_0", "user_0"), Arrays.asList(new RangeShardValue(2l, 3l)));
        expectedResult.put(new ShardRouteInfo("member_0", "user_1"), Arrays.asList(new RangeShardValue(4l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(null, 4L);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member", "user_0"), Arrays.asList(new RangeShardValue(2l, 3l)));
        expectedResult.put(new ShardRouteInfo("member", "user_1"), Arrays.asList(new RangeShardValue(4l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(8l, null);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member_0", "user"), Arrays.asList(new RangeShardValue(2l, 7l)));
        Assert.equals(map, expectedResult);

        //
        rule = new DivideShardRouteRule(null, null);
        map = rule.groupSdValuesByRouteInfo("member", "user", new RangeShardValue(2l, 7l));
        expectedResult = new LinkedHashMap<>();
        expectedResult.put(new ShardRouteInfo("member", "user"), Arrays.asList(new RangeShardValue(2l, 7l)));
        Assert.equals(map, expectedResult);
    }

    @Test
    public void test04() {