### Question:
LongVar extends AbstractVarType<Long> { public static LongVar longVar(String id) { return new LongVar(id); } private  LongVar(String id); private  LongVar(String id, String regex); static LongVar longVar(String id); static LongVar longVar(String id, String regex); @Override Long convert(String value);  }### Answer:
@Test public void whenNegLongIsCorrectThenLongIsReturned() { RestParser parser = parser("/users/{}", longVar("userId")); RestUrl url = parser.parse("http: assertThat(url, isValid()); assertThat((Long) url.variable("userId"), is(-9223372036854775807L)); }
@Test public void whenLongIsIncorrectThenUrlIsInvalid() { RestParser parser = parser("/users/{}", longVar("userId")); RestUrl url = parser.parse("http: assertThat(url, isInvalid()); }
@Test public void whenVariableIsEmptyThenUrlIsInvalid() { RestParser parser = parser("/users/{}", longVar("userId")); RestUrl url = parser.parse("http: assertThat(url, isInvalid()); }