Unit test for filter application [closed]

1

I want to create a unit test for the method:

public BufferedImage negativo(BufferedImage image) {

    int width = image.getWidth();
    int height = image.getHeight();
    for (int i = 0; i < width; i++) {
        for (int j = 0; j < height; j++) {               
            int rgb = image.getRGB(i, j);                                
            int r = 255 - (int)((rgb&0x00FF0000)>>>16);
            int g = 255 - (int)((rgb&0x0000FF00)>>>8);
            int b = 255 - (int) (rgb&0x000000FF);
            Color color = new Color(r, g, b);
            image.setRGB(i, j, color.getRGB());

            }

  }

    return image;

}

Does anyone have a solution?

    
asked by anonymous 29.11.2016 / 01:37

0 answers