package com.google.code.beanmatchers;

import org.hamcrest.Description;

import java.util.List;

import static java.util.Arrays.asList;

public class HasToStringDescribingPropertiesMatcher<T> extends AbstractBeanToStringMatcher<T> {


    private final List<String> excludedProperties;

    public HasToStringDescribingPropertiesMatcher(TypeBasedValueGenerator valueGenerator, String... excludedProperties) {
        super(valueGenerator);
        this.excludedProperties = asList(excludedProperties);
    }

    @Override
    protected boolean matchesSafely(Class beanType, Description mismatchDescription) {
        return super.toStringDescribesProperties(beanType, excludedProperties, mismatchDescription);
    }

    public void describeTo(Description description) {
        description.appendText("bean with toString() describing class name and the properties ");
        description.appendValue(excludedProperties);
    }
}

@@ -259,25 +259,17 @@
 String%3E 
-excludedP
+p
 ropertie
@@ -372,25 +372,17 @@
 ring... 
-excludedP
+p
 ropertie
@@ -430,25 +430,17 @@
    this.
-excludedP
+p
 ropertie
@@ -450,25 +450,17 @@
  asList(
-excludedP
+p
 ropertie
@@ -630,25 +630,17 @@
 anType, 
-excludedP
+p
 ropertie
@@ -859,17 +859,9 @@
 lue(
-excludedP
+p
 rope

Rename excludedProperties to properties