NcFileStitcher { static int determineSectionSize(int indexOfRowDimension, Variable variable) { int size = 1; for (int i = indexOfRowDimension; i < variable.getDimensions().size(); i++) { size *= variable.getDimension(i).getLength(); } return size; }    }
@Test public void testDetermineSectionSize() throws IOException, URISyntaxException { final File f1_BT_io_file = getSecondNcFile("F1_BT_io.nc"); final NetcdfFile f1_BT_io_netcdfFile = NetcdfFileOpener.open(f1_BT_io_file); assertNotNull(f1_BT_io_netcdfFile); final Variable f1_BT_io_variable = f1_BT_io_netcdfFile.getVariables().get(0); assertEquals(1800000, NcFileStitcher.determineSectionSize(0, f1_BT_io_variable)); final File met_tx_file = getFirstNcFile("met_tx.nc"); final NetcdfFile met_tx_netcdfFile = NetcdfFileOpener.open(met_tx_file); assertNotNull(met_tx_netcdfFile); final Variable u_wind_tx_variable = met_tx_netcdfFile.getVariables().get(11); assertEquals(260000, NcFileStitcher.determineSectionSize(2, u_wind_tx_variable)); }