### Question:
PgIntRange { public static Range parse(String s) { Matcher m = PATTERN.matcher(s); if (!m.matches()) { throw new IllegalArgumentException("Invalid range value: " + s); } Range.Mode lowerMode = parseMode(m.group(1)); int lower = Integer.parseInt(m.group(2)); int upper = Integer.parseInt(m.group(3)); Range.Mode upperMode = parseMode(m.group(4)); return Range.builder() .lowerMode(lowerMode) .lower(lower) .upper(upper) .upperMode(upperMode) .build(); } private  PgIntRange(); static Range parse(String s);  }### Answer:
@Test public void test() throws Exception { String s = "[123,234)"; Range r = PgIntRange.parse(s); assertEquals(Range.Mode.INCLUSIVE, r.lowerMode()); assertEquals(123, r.lower()); assertEquals(234, r.upper()); assertEquals(Range.Mode.EXCLUSIVE, r.upperMode()); }