@Test public void inequalityTest() { ERE a_x10 = Repeat.get(a, 10); Symbol b = Symbol.get("b"); ERE b_x5 = Repeat.get(b, 5); assertFalse(a_x5.equals(a_x10)); assertFalse(0 == a_x5.compareTo(a_x10)); assertFalse(a_x5.equals(b_x5)); assertFalse(0 == a_x5.compareTo(b_x5)); }
public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } }
Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } } }
Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } }  }
Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } }  static ERE get(ERE child, int num); }
Repeat { public static ERE get(ERE child, int num) { if(num < 1) { return Empty.get(); } else if(num == 1) { return child; } else { ERE ret = Concat.get(child, child); for(int i = 2; i < num; ++i) { ret = Concat.get(child, ret); } return ret; } }  static ERE get(ERE child, int num);  }