### Question:
FloatVar extends AbstractVarType<Float> { public static FloatVar floatVar(String id) { return new FloatVar(id); } private  FloatVar(String id); private  FloatVar(String id, String regex); static FloatVar floatVar(String id); static FloatVar floatVar(String id, String regex); @Override Float convert(String value);  }### Answer:
@Test public void whenKeyIsWellSetThenValueIsCorrect() { RestParser parser = parser("/users/{}", floatVar("userId")); Float userId = Float.MAX_VALUE; RestUrl url = parser.parse("http: assertThat(url, isValid()); assertThat((Float) url.variable("userId"), is(userId)); }
@Test public void whenVariableIsEmptyThenUrlIsInvalid() { RestParser parser = parser("/users/{}", floatVar("userId")); RestUrl url = parser.parse("http: assertThat(url, isInvalid()); }