code: public static Buffer ensureNotEmpty(final Buffer reference, final String msg) throws IllegalArgumentException {
          if (reference == null || reference.isEmpty()) {
              throw new IllegalArgumentException(msg);
          }
          return reference;
      }
docs: Assert that the {@link Buffer} is not null nor empty.
  
  @param reference
  @param msg
  @return
  @throws IllegalArgumentException