### Question:
Variable implements VariableSimpleIF, ProxyReader { @Deprecated public float readScalarFloat() throws IOException { Array data = _readScalarData(); return data.getFloat(Index.scalarIndexImmutable); } protected  Variable(Builder<?> builder, Group parentGroup); int findDimensionIndex(String name); String getDatasetLocation(); DataType getDataType(); String getDescription(); ImmutableList<Dimension> getDimensions(); Dimension getDimension(int i); String getDimensionsString(); int getElementSize(); @Nullable EnumTypedef getEnumTypedef(); @Nullable String getFileTypeId(); String getFullName(); @Nullable NetcdfFile getNetcdfFile(); Group getParentGroup(); @Nullable Structure getParentStructure(); ImmutableList<Range> getRanges(); int getRank(); int[] getShape(); int getShape(int index); Section getShapeAsSection(); String getShortName(); long getSize(); @Nullable String getUnitsString(); boolean isCoordinateVariable(); boolean isMemberOfStructure(); boolean isMetadata(); boolean isScalar(); boolean isUnlimited(); boolean isVariableLength(); @Nullable String lookupEnumString(int val); Variable section(List<Range> ranges); Variable section(Section subsection); Variable slice(int dim, int value); Variable reduce(List<Dimension> dims); long readToStream(Section section, OutputStream out); @Deprecated Array read(int[] origin, int[] shape); @Deprecated Array read(String sectionSpec); @Deprecated Array read(List<Range> ranges); @Deprecated Array read(ucar.ma2.Section section); @Deprecated Array read(); @Deprecated byte readScalarByte(); @Deprecated short readScalarShort(); @Deprecated int readScalarInt(); @Deprecated long readScalarLong(); @Deprecated float readScalarFloat(); @Deprecated double readScalarDouble(); @Deprecated String readScalarString(); ucar.array.Array<?> readArray(); ucar.array.Array<?> readArray(ucar.ma2.Section section); @Override @Deprecated Array reallyRead(Variable client, CancelTask cancelTask); @Override ucar.array.Array<?> proxyReadArray(Variable client, CancelTask cancelTask); @Override @Deprecated Array reallyRead(Variable client, Section section, CancelTask cancelTask); @Override ucar.array.Array<?> proxyReadArray(Variable client, Section section, CancelTask cancelTask); String getNameAndDimensions(); void getNameAndDimensions(Formatter buf, boolean useFullName, boolean strict); String toString(); String toStringDebug(); @Override boolean equals(Object oo); @Override int hashCode(); int compareTo(VariableSimpleIF o); @Override AttributeContainer attributes(); @Nullable Attribute findAttribute(String name); String findAttributeString(String attName, String defaultValue); @Deprecated void resetShape(); Object getSPobject(); int getSizeToCache(); void setCaching(boolean caching); boolean isCaching(); void invalidateCache(); boolean hasCachedData(); Builder<?> toBuilder(); static Builder<?> builder(); static boolean permitCaching; }### Answer:
@Test public void testReadScalarFloat() throws IOException { Variable varb = Variable.builder().setName("varb").setDataType(DataType.FLOAT).setAutoGen(11, 1).build(makeDummyGroup()); assertThat(varb.readScalarByte()).isEqualTo((byte) 11); assertThat(varb.readScalarShort()).isEqualTo((short) 11); assertThat(varb.readScalarInt()).isEqualTo(11); assertThat(varb.readScalarLong()).isEqualTo((long) 11); assertThat(varb.readScalarFloat()).isEqualTo((float) 11); assertThat(varb.readScalarDouble()).isEqualTo((double) 11); }