### Question:
Dimensions { public static long getSize(Iterable<Dimension> dimensions) { long size = 1; for (Dimension dim : dimensions) { if (dim.getLength() >= 0) size *= dim.getLength(); } return size; } private  Dimensions(); static ucar.ma2.Section.Builder makeSectionFromDimensions(Iterable<Dimension> dimensions); static long getSize(Iterable<Dimension> dimensions); static int[] makeShapeAll(Variable v); static int[] makeShape(Iterable<Dimension> dimensions); static String makeDimensionsString(List<Dimension> dimensions); static ImmutableList<Dimension> makeDimensionsList(FindDimensionByName finder, String dimString); static ImmutableList<Dimension> makeDimensionsAnon(int[] shape); static ImmutableList<Dimension> makeDimensionsAll(Variable v);  }### Answer:
@Test public void testSize() { Dimension dim1 = new Dimension("dim1", 5); Dimension dim2 = new Dimension("dim2", 6); Dimension dim3 = new Dimension("dim3", 7); assertThat(Dimensions.getSize(ImmutableList.of(dim1, dim2, dim3))).isEqualTo(210); }