### Question:
ImageUtil { public static BufferedImage toBufferedImage(String oldFile, ImageParamDTO params) throws IOException { if (StringUtils.isBlank(oldFile)) { logger.error("原文件名或目标文件名为空"); return null; } Thumbnails.Builder builder = Thumbnails.of(oldFile); fillBuilderWithParams(builder, params); if (null == builder) { return null; } return builder.asBufferedImage(); }  static void toFile(String oldFile, String newFile, ImageParamDTO params); static BufferedImage toBufferedImage(String oldFile, ImageParamDTO params); static OutputStream toOutputStream(InputStream input, OutputStream output, ImageParamDTO params); static String getContentType(byte[] content); static final InputStream bytes2InputStream(byte[] buf); static final byte[] inputStream2bytes(InputStream inStream);  }### Answer:
@Test public void testToBufferedImage() throws IOException { final String oldFile = System.getProperty("user.dir") + "/src/test/resources/images/lion2.jpg"; ImageParamDTO params = new ImageParamDTO(); params.setWidth(64); params.setHeight(64); BufferedImage bufferedImage = ImageUtil.toBufferedImage(oldFile, params); Assert.assertNotNull(bufferedImage); }