### Question:
Attribute { public static Builder builder() { return new Builder(); } 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 testBuilder() { Attribute att = Attribute.builder().setName("name").setDataType(DataType.FLOAT) .setValues(Array.makeArray(DataType.FLOAT, ImmutableList.of("3.14", ".0015"))).build(); assertThat(att.getName()).isEqualTo("name"); assertThat(att.getShortName()).isEqualTo("name"); assertThat(att.getDataType()).isEqualTo(DataType.FLOAT); assertThat(att.getLength()).isEqualTo(2); assertThat(att.getValue(0)).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getValue(1)).isEqualTo(Float.parseFloat(".0015")); assertThat(att.getNumericValue()).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getNumericValue(0)).isEqualTo(Float.parseFloat("3.14")); assertThat(att.getNumericValue(1)).isEqualTo(Float.parseFloat(".0015")); assertThat(att.isArray()).isTrue(); assertThat(att.isString()).isFalse(); assertThat(att.getStringValue()).isNull(); assertThat(att.getEnumType()).isNull(); }
@Test public void testSetValuesChar() { char[] carray = new char[] {'a', 'b', 'd'}; int[] shape = new int[] {3}; Array data = Array.factory(DataType.CHAR, shape, carray); Attribute att = Attribute.builder().setName("name").setValues(data).build(); assertThat(att).isEqualTo(new Attribute("name", "abd")); }