### Question:
EncodedDoubleValue extends EncodedValue { public long setDoubleValue(long flags, double value) { if (Double.isNaN(value)) throw new IllegalArgumentException("Value cannot be NaN"); long tmpValue = Math.round(value / factor); checkValue((long) (tmpValue * factor)); tmpValue <<= shift; flags &= ~mask; return flags | tmpValue; } EncodedDoubleValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue);  EncodedDoubleValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero); @Override long setValue(long flags, long value); @Override long getValue(long flags); @Override long setDefaultValue(long flags); long setDoubleValue(long flags, double value); double getDoubleValue(long flags);  }### Answer:
@Test public void testSetDoubleValue() { EncodedDoubleValue instance = new EncodedDoubleValue("test", 6, 10, 0.01, 5, 10); assertEquals(10.12, instance.getDoubleValue(instance.setDoubleValue(0, 10.12)), 1e-4); }