### Question:
GraphOperationBuilder implements OperationBuilder { private static void setAttrShapeList(TF_OperationDescription handle, String name, long[] shapes, int[] numDims) { requireHandle(handle); try (PointerScope scope = new PointerScope()) { LongPointer shapesPointer = new LongPointer(shapes); PointerPointer<LongPointer> shapesPointers = new PointerPointer<LongPointer>(numDims.length); for (int i = 0; i < numDims.length; i++) { shapesPointers.put(i, shapesPointer); shapesPointer.position(shapesPointer.position() + numDims[i] * 8); } TF_SetAttrShapeList(handle, new BytePointer(name), shapesPointers, new IntPointer(numDims), numDims.length); } } GraphOperationBuilder(Graph graph, String type, String name); @Override GraphOperation build(); @Override GraphOperationBuilder addControlInput(Operation control); @Override GraphOperationBuilder addInput(Output<?> input); @Override GraphOperationBuilder addInputList(Output<?>[] inputs); @Override GraphOperationBuilder setDevice(String device); @Override GraphOperationBuilder setAttr(String name, String value); @Override GraphOperationBuilder setAttr(String name, byte[] value); @Override GraphOperationBuilder setAttr(String name, long value); @Override GraphOperationBuilder setAttr(String name, long[] value); @Override GraphOperationBuilder setAttr(String name, float value); @Override GraphOperationBuilder setAttr(String name, float[] value); @Override GraphOperationBuilder setAttr(String name, boolean value); @Override GraphOperationBuilder setAttr(String name, boolean[] value); @Override GraphOperationBuilder setAttr(String name, DataType value); @Override GraphOperationBuilder setAttr(String name, DataType[] value); @Override GraphOperationBuilder setAttr(String name, Tensor<?> value); @Override GraphOperationBuilder setAttr(String name, Tensor<?>[] value); @Override GraphOperationBuilder setAttr(String name, Shape value); @Override GraphOperationBuilder setAttr(String name, Shape[] value); @Override GraphOperationBuilder setAttr(String name, String[] value);  }### Answer:
@Test public void setAttrShapeList() { testSetAttrShapeList(new Shape[] {Shape.of(2, 2), Shape.of(2, 2, 2)}); try { testSetAttrShapeList(new Shape[] {Shape.of(2, 2), Shape.of(2, 2, 2, 2)}); fail("Shapes are incompatible and an exception was expected"); } catch (TFInvalidArgumentException e) { } }