### Question:
Dimensions { public static ImmutableList<Dimension> makeDimensionsAnon(int[] shape) { if ((shape == null) || (shape.length == 0)) { return ImmutableList.of(); } ImmutableList.Builder<Dimension> newDimensions = ImmutableList.builder(); for (int len : shape) { newDimensions.add(Dimension.builder().setIsVariableLength(len == -1).setLength(len).setIsShared(false).build()); } return newDimensions.build(); } 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 testMakeDimensionsAnon() { ImmutableList<Dimension> list = Dimensions.makeDimensionsAnon(new int[] {5, 6, 7}); Dimension dim1 = Dimension.builder().setIsShared(false).setLength(5).build(); Dimension dim2 = Dimension.builder().setIsShared(false).setLength(6).build(); Dimension dim3 = Dimension.builder().setIsShared(false).setLength(7).build(); assertThat(ImmutableList.of(dim1, dim2, dim3)).isEqualTo(list); assertThat(Dimensions.makeDimensionsAnon(new int[0])).isEmpty(); }