code: public static BufferedImage appendImages(BufferedImage leftImage,
              BufferedImage rightImage) {
          Preconditions.checkNotNull(leftImage);
          Preconditions.checkNotNull(rightImage);
          int width = leftImage.getWidth() + rightImage.getWidth();
          int height = Math.max(leftImage.getHeight(), rightImage.getHeight());
          BufferedImage result = new BufferedImage(width, height,
                  leftImage.getType());
          result.createGraphics().drawImage(leftImage, 0, 0, null);
          result.createGraphics().drawImage(rightImage, leftImage.getWidth(), 0, null);
          return result;
      }
docs: Appends rightImage to the right side of leftImage.
  <p>
  The resulting image type is one of leftImage.
  
  @param leftImage
  first image, must not be null
  @param rightImage
  second image that is appended to the right side of leftImage,
  must not be null
  @return appended image