Example usage for java.util TreeSet toString

List of usage examples for java.util TreeSet toString

Introduction

In this page you can find the example usage for java.util TreeSet toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.openqa.selenium.TakesScreenshotTest.java

private void compareColors(Set<String> expectedColors, Set<String> actualColors) {
    TreeSet<String> c = new TreeSet<String>(expectedColors);
    c.removeAll(actualColors);//from  w  w w.  j a  va2 s  .  co m
    if (!c.isEmpty()) {
        fail("Unknown expected color is generated: " + c.toString() + ", \n" + " actual colors are: "
                + actualColors.toString());
    }

    if (actualColors.containsAll(expectedColors)) {
        // all is ok
    } else {
        actualColors.removeAll(expectedColors);
        fail("Unknown colors are presented at screenshot: " + actualColors.toString() + " \n"
                + " expected colors are excluded: " + expectedColors.toString());
    }
}