### Question:
Attribute { void writeCDL(Formatter f, boolean strict, String parentname) { if (strict && (isString() || this.getEnumType() != null)) { f.format("string "); } if (strict && parentname != null) { f.format(NetcdfFiles.makeValidCDLName(parentname)); } f.format(":"); f.format("%s", strict ? NetcdfFiles.makeValidCDLName(getShortName()) : getShortName()); if (isString()) { f.format(" = "); for (int i = 0; i < getLength(); i++) { if (i != 0) { f.format(", "); } String val = getStringValue(i); if (val != null) { f.format("\"%s\"", encodeString(val)); } } } else if (getEnumType() != null) { f.format(" = "); for (int i = 0; i < getLength(); i++) { if (i != 0) { f.format(", "); } EnumTypedef en = getEnumType(); Integer intValue = (Integer) getValue(i); String ecname = intValue == null ? "" : en.lookupEnumString(intValue); if (ecname == null) { ecname = Integer.toString(intValue); } f.format("\"%s\"", encodeString(ecname)); } } else { f.format(" = "); for (int i = 0; i < getLength(); i++) { if (i != 0) { f.format(", "); } Number number = getNumericValue(i); if (dataType.isUnsigned()) { number = DataType.widenNumber(number); } f.format("%s", number); if (dataType.isUnsigned()) { f.format("U"); } if (dataType == DataType.FLOAT) f.format("f"); else if (dataType == DataType.SHORT || dataType == DataType.USHORT) { f.format("S"); } else if (dataType == DataType.BYTE || dataType == DataType.UBYTE) { f.format("B"); } else if (dataType == DataType.LONG || dataType == DataType.ULONG) { f.format("L"); } } } } Attribute(String name, @Nullable String val);  Attribute(String name, Number val); private  Attribute(Builder builder); static Attribute fromParameter(Parameter param); static Attribute fromArray(String name, ucar.ma2.Array values); static Attribute fromArray(String name, Array<?> values); static Attribute emptyValued(String name, DataType dtype); DataType getDataType(); @Nullable EnumTypedef getEnumType(); int getLength(); String getName(); @Nullable Number getNumericValue(); @Nullable Number getNumericValue(int index); String getShortName(); @Nullable String getStringValue(); @Nullable String getStringValue(int index); @Nullable Object getValue(int index); @Nullable ucar.ma2.Array getValues(); @Nullable ucar.array.Array<?> getArrayValues(); boolean isArray(); boolean isString(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); Builder toBuilder(); static Builder builder(); static Builder builder(String name);  }### Answer:
@Test public void testWriteCDL() { Attribute att = Attribute.builder().setName("name").setValues(ImmutableList.of(1, 2, 3), true).build(); Formatter f = new Formatter(); att.writeCDL(f, false, null); assertThat(f.toString()).isEqualTo(":name = 1U, 2U, 3U"); }