### Question:
NumberField implements FieldType<Number> { public Integer getScale() { return scale; } NumberField(final Types type);  NumberField(final Types type, final Number defaultValue);  NumberField(final Types type, final int precision);  NumberField(final int scale, final Types type);  NumberField(final Types type, final int precision, final Number defaultValue);  NumberField(final int scale, final Types type, final Number defaultValue);  NumberField(final Types type, final int precision, final int scale);  NumberField(final Types type, final int precision, final int scale, final Number defaultValue); @Override Types getType(); int getPrecision(); Integer getScale(); @Override Number getDefaultValue(); @Override boolean hasDefaultValue(); @Override Number convert(Object objValue); @Override JSONObject toJson();  }### Answer:
@Test public void testGetScale() throws OperationException { System.out.println("getScale"); for (Types type : Types.values()) { if (!isNumberType(type)) { continue; } assertEquals(getDefaultScale(type, false), new NumberField(type).getScale()); assertEquals(getDefaultScale(type, false), new NumberField(type, new Integer(0)).getScale()); if (typeTakesScale(type)) { assertEquals(new Integer(0), new NumberField(0, type).getScale()); assertEquals(new Integer(0), new NumberField(0, type, new Integer(0)).getScale()); if (typeTakesPrecision(type)) { assertEquals(new Integer(0), new NumberField(type, 1, 0).getScale()); assertEquals(new Integer(0), new NumberField(type, 1, 0, new Integer(0)).getScale()); } } else if (typeTakesPrecision(type)) { if (type == Types.FLOAT) { assertEquals(getDefaultScale(type, true), new NumberField(type, 24).getScale()); assertEquals(getDefaultScale(type, true), new NumberField(type, 24, new Integer(0)).getScale()); } else { assertEquals(getDefaultScale(type, true), new NumberField(type, 38).getScale()); assertEquals(getDefaultScale(type, true), new NumberField(type, 38, new Integer(0)).getScale()); } } } }