code: public static void checkDivisibleDataLength(String parameterName,
              int dataLength, int expectedComponents) {
          if (dataLength == 0 || dataLength % expectedComponents != 0) {
              throw Exceptions
                      .IllegalArgument(
                              "The input array of %s should be an array of %d-component elements whose length is non-zero and divisible by %d. But current data length is %d.",
                              parameterName, expectedComponents,
                              expectedComponents, dataLength);
          }
      }
docs: Check arrays of tuples: is the array length a multiple of the tuple size?
  
  @param parameterName
  The name of the user-supplied parameter that we are validating
  so that the user can easily find the error in their code.
  @param dataLength
  Array parameter length
  @param expectedComponents
  Expected number of components.
  @throws IllegalArgumentException
  If the dataLength is zero or not divisible by the expected
  number.