### Question:
VarInt { public static int getLength(int v) { return getLength(convertIntToLongNoSignExtend(v)); }  static void encode(int v, OutputStream buf); static void encode(long v, OutputStream buf); static int decodeInt(InputStream buf); static long decodeLong(InputStream buf); static int getLength(int v); static int getLength(long v);  }### Answer:
@Test public void encodeValuesAndGetLength() throws IOException { assertEquals(LONG_VALUES.length, LONG_ENCODED.length); for (int i = 0; i < LONG_VALUES.length; ++i) { byte[] encoded = encodeLong(LONG_VALUES[i]); assertThat(encoded, equalTo(LONG_ENCODED[i])); assertEquals(LONG_ENCODED[i].length, VarInt.getLength(LONG_VALUES[i])); } assertEquals(INT_VALUES.length, INT_ENCODED.length); for (int i = 0; i < INT_VALUES.length; ++i) { byte[] encoded = encodeInt(INT_VALUES[i]); assertThat(encoded, equalTo(INT_ENCODED[i])); assertEquals(INT_ENCODED[i].length, VarInt.getLength(INT_VALUES[i])); } }