code: private void validateEntry(String key, Object value) {
          if (isBlank(key)) {
              throw new IllegalArgumentException("key cannot be null/blank");
          }
          if (ModifiedUTF8Charset.calculateByteLength(key) > 255) {
              throw new IllegalArgumentException("key length > 255 bytes");
          }
          else if (value == null) {
              throw new IllegalArgumentException("value cannot be null");
          }
          else if (value instanceof String) {
              if (ModifiedUTF8Charset.calculateByteLength((String) value) > 32767) {
                  throw new IllegalArgumentException("string value length > 34767 bytes");
              }
          }
          else if (value instanceof Integer ||
                   value instanceof Long ||
                   value instanceof Double) {
              // valid
          } else {
              throw new IllegalArgumentException("Illegal value type: "+value.getClass().toString());
          }
      }
docs: validation:
  enforces key length less than 256 UTF8 bytes
  enforces valid value type (cannot be null)
  enforces valid String value length less than 32767 UTF8 bytes