### Question:
Shape { public boolean isLayoutKnown() { return !Arrays.stream(layout).allMatch(l -> l == LayoutType.UNKNOWN); } Shape(long... shape);  Shape(List<Long> shape);  Shape(PairList<Long, LayoutType> shape);  Shape(long[] shape, String layout);  Shape(long[] shape, LayoutType[] layout); static Shape update(Shape shape, int dimension, long value); long[] getShape(); long get(int dimension); LayoutType getLayoutType(int dimension); long size(int... dimensions); long size(); int dimension(); long getUnknownValueCount(); Shape slice(int beginIndex); Shape slice(int beginIndex, int endIndex); Shape filterByLayoutType(Predicate<LayoutType> predicate); Shape map(Function<Pair<Long, LayoutType>, Pair<Long, LayoutType>> mapper); Stream<Pair<Long, LayoutType>> stream(); Shape add(long... axes); Shape addAll(Shape other); long head(); int getTrailingOnes(); int getLeadingOnes(); boolean isScalar(); boolean hasZeroDimension(); boolean isLayoutKnown(); LayoutType[] getLayout(); String toLayoutString(); byte[] getEncoded(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Shape decode(DataInputStream dis);  }### Answer:
@Test public void testHasLayout() { Shape withLayout = new Shape( new long[] {2, 2}, new LayoutType[] {LayoutType.BATCH, LayoutType.CHANNEL}); Shape withoutLayout = new Shape(2, 2); Assert.assertTrue(withLayout.isLayoutKnown()); Assert.assertFalse(withoutLayout.isLayoutKnown()); }