### Question:
SparkSchemaUtil { public static long estimateSize(StructType tableSchema, long totalRecords) { if (totalRecords == Long.MAX_VALUE) { return totalRecords; } long approximateSize = 0; for (StructField sparkField : tableSchema.fields()) { approximateSize += sparkField.dataType().defaultSize(); } long result = approximateSize * totalRecords; return result > 0 ? result : Long.MAX_VALUE; } private  SparkSchemaUtil(); static Schema schemaForTable(SparkSession spark, String name); static PartitionSpec specForTable(SparkSession spark, String name); static StructType convert(Schema schema); static DataType convert(Type type); static Schema convert(StructType sparkType); static Type convert(DataType sparkType); static Schema convert(Schema baseSchema, StructType sparkType); static Schema prune(Schema schema, StructType requestedType); static Schema prune(Schema schema, StructType requestedType, List<Expression> filters); static Schema prune(Schema schema, StructType requestedType, Expression filter, boolean caseSensitive); static long estimateSize(StructType tableSchema, long totalRecords);  }### Answer:
@Test public void testEstiamteSizeMaxValue() throws IOException { Assert.assertEquals("estimateSize returns Long max value", Long.MAX_VALUE, SparkSchemaUtil.estimateSize( null, Long.MAX_VALUE)); }