tensorflow_lite_support/java/src/javatests/org/tensorflow/lite/support/image/ColorSpaceTypeTest.java [99:123]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static final String RGB_ASSERT_SHAPE_MESSAGE =
        "The shape of a RGB image should be (h, w, c) or (1, h, w, c), and channels"
            + " representing R, G, B in order. The provided image shape is ";
    private static final String GRAYSCALE_ASSERT_SHAPE_MESSAGE =
        "The shape of a grayscale image should be (h, w) or (1, h, w, 1). The provided image"
            + " shape is ";

    @Parameter(0)
    public ColorSpaceType colorSpaceType;

    /** The shape that does not match the colorSpaceType. */
    @Parameter(1)
    public int[] invalidShape;

    @Parameter(2)
    public String errorMessage;

    @Parameters(name = "colorSpaceType={0}; invalidShape={1}")
    public static Collection<Object[]> data() {
      return Arrays.asList(
          new Object[][] {
            {ColorSpaceType.RGB, new int[] {2, 10, 20, 3}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20, 3, 4}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20, 5}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20}, RGB_ASSERT_SHAPE_MESSAGE},
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tensorflow_lite_support/java/src/javatests/org/tensorflow/lite/support/image/TensorImageTest.java [698:722]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static final String RGB_ASSERT_SHAPE_MESSAGE =
        "The shape of a RGB image should be (h, w, c) or (1, h, w, c), and channels"
            + " representing R, G, B in order. The provided image shape is ";
    private static final String GRAYSCALE_ASSERT_SHAPE_MESSAGE =
        "The shape of a grayscale image should be (h, w) or (1, h, w, 1). The provided image"
            + " shape is ";

    @Parameter(0)
    public ColorSpaceType colorSpaceType;

    /** The shape that does not match the colorSpaceType. */
    @Parameter(1)
    public int[] invalidShape;

    @Parameter(2)
    public String errorMessage;

    @Parameters(name = "colorSpaceType={0}; invalidShape={1}")
    public static Collection<Object[]> data() {
      return Arrays.asList(
          new Object[][] {
            {ColorSpaceType.RGB, new int[] {2, 10, 20, 3}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20, 3, 4}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20, 5}, RGB_ASSERT_SHAPE_MESSAGE},
            {ColorSpaceType.RGB, new int[] {1, 10, 20}, RGB_ASSERT_SHAPE_MESSAGE},
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



