code: public static MessageValidity validMessage(NDArrayMessage message) {
          if (message.getDimensions() == null || message.getArr() == null)
              return MessageValidity.NULL_VALUE;
  
          if (message.getIndex() != -1 && message.getDimensions().length == 1 && message.getDimensions()[0] != -1)
              return MessageValidity.INCONSISTENT_DIMENSIONS;
          return MessageValidity.VALID;
      }
docs: Returns if a message is valid or not based on a few simple conditions:
  no null values
  both index and the dimensions array must be -1 and of length 1 with an element of -1 in it
  otherwise it is a valid message.
  @param message the message to validate
  @return 1 of: NULL_VALUE,INCONSISTENT_DIMENSIONS,VALID see {@link MessageValidity}