### Question:
ConfigKey { public short getShort(Configuration conf) { checkArgument(type() == Type.SHORT, "'" + name() + "' is NOT a SHORT numeric setting"); return conf.getShort(name(), (Short) defaultValue()); }  static ConfigKeyBuilder builder(String name); @Override boolean equals(Object o); @Override int hashCode(); void validate(Configuration conf); void set(Configuration conf, Object value); long getLong(Configuration conf); int getInt(Configuration conf); short getShort(Configuration conf); boolean getBoolean(Configuration conf); double getDouble(Configuration conf); String getString(Configuration conf); @SuppressWarnings("unchecked") Class<? extends T> getClass(Configuration conf, Class<T> interfaceCls); @SuppressWarnings("unchecked") Class<?> getClass(Configuration conf); @SuppressWarnings("unchecked") List<Object> getList(Configuration conf); Object get(Configuration conf); static final Comparator<ConfigKey> ORDERING; }### Answer:
@Test public void testGetShort() { String keyName = runtime.getMethodName(); short defaultValue = (short) ThreadLocalRandom.current().nextInt(10000); ConfigKey key = ConfigKey.builder(keyName) .required(true) .type(Type.SHORT) .defaultValue(defaultValue) .build(); Configuration conf = new ConcurrentConfiguration(); assertEquals(defaultValue, key.getShort(conf)); assertEquals(defaultValue, key.get(conf)); short newValue = (short) (defaultValue * 2); key.set(conf, newValue); assertEquals(newValue, key.getShort(conf)); assertEquals(newValue, key.get(conf)); }