// Path: src/test/java/com/google/code/beanmatchers/data/TestBeanWithIntegerProperty.java
// public class TestBeanWithIntegerProperty {
// 
//   private Integer integerProperty;
// 
//   public Integer getIntegerProperty() {
//     return integerProperty;
//   }
// 
//   public void setIntegerProperty(Integer integerProperty) {
//     this.integerProperty = integerProperty;
//   }
// }
// 
// Path: src/test/java/com/google/code/beanmatchers/data/TestBeanWithOneProperty.java
// public class TestBeanWithOneProperty {
// 
//   private Object field1;
// 
//   public Object getField1() {
//     return field1;
//   }
// 
//   public void setField1(Object field1) {
//     this.field1 = field1;
//   }
// 
//   @Override
//   public boolean equals(Object o) {
//     if (this == o) return true;
//     if (o == null || getClass() != o.getClass()) return false;
// 
//     TestBeanWithOneProperty that = (TestBeanWithOneProperty) o;
// 
//     if (field1 != null ? !field1.equals(that.field1) : that.field1 != null) return false;
// 
//     return true;
//   }
// 
//   @Override
//   public int hashCode() {
//     return field1 != null ? field1.hashCode() : 0;
//   }
// 
//   @Override
//   public String toString() {
//     return getClass().getSimpleName() + "{field1=" + field1 + "}";
//   }
// }


import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import com.google.code.beanmatchers.data.TestBeanWithIntegerProperty;
import com.google.code.beanmatchers.data.TestBeanWithOneProperty;
import java.util.List;
import org.testng.annotations.Test;

  @Test
  public void canSetPropertyOnBean() {
    // given
    Object value = "test value";
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
    unitUnderTest = new JavaBean(bean);

    // when
    unitUnderTest.setProperty("field1", value);

    // then
    assertThat(bean.getField1(), is(value));
  }

  @Test(expectedExceptions = BeanMatchersException.class)
  public void setPropertyShouldThrowExceptionGivenPropertyDoesNotExistOnBean() {
    // given
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
    unitUnderTest = new JavaBean(bean);

    // when
    unitUnderTest.setProperty("propertyThatDoesNotExist", new Object());
  }

  @Test
  public void canGetPropertyFromBean() {
    // given
    Object expectedValue = "test value";
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
// Path: src/test/java/com/google/code/beanmatchers/data/TestBeanWithIntegerProperty.java
// public class TestBeanWithIntegerProperty {
// 
//   private Integer integerProperty;
// 
//   public Integer getIntegerProperty() {
//     return integerProperty;
//   }
// 
//   public void setIntegerProperty(Integer integerProperty) {
//     this.integerProperty = integerProperty;
//   }
// }
// 
// Path: src/test/java/com/google/code/beanmatchers/data/TestBeanWithOneProperty.java
// public class TestBeanWithOneProperty {
// 
//   private Object field1;
// 
//   public Object getField1() {
//     return field1;
//   }
// 
//   public void setField1(Object field1) {
//     this.field1 = field1;
//   }
// 
//   @Override
//   public boolean equals(Object o) {
//     if (this == o) return true;
//     if (o == null || getClass() != o.getClass()) return false;
// 
//     TestBeanWithOneProperty that = (TestBeanWithOneProperty) o;
// 
//     if (field1 != null ? !field1.equals(that.field1) : that.field1 != null) return false;
// 
//     return true;
//   }
// 
//   @Override
//   public int hashCode() {
//     return field1 != null ? field1.hashCode() : 0;
//   }
// 
//   @Override
//   public String toString() {
//     return getClass().getSimpleName() + "{field1=" + field1 + "}";
//   }
// }


// Path: src/test/java/com/google/code/beanmatchers/JavaBeanTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import com.google.code.beanmatchers.data.TestBeanWithIntegerProperty;
import com.google.code.beanmatchers.data.TestBeanWithOneProperty;
import java.util.List;
import org.testng.annotations.Test;


  @Test
  public void canSetPropertyOnBean() {
    // given
    Object value = "test value";
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
    unitUnderTest = new JavaBean(bean);

    // when
    unitUnderTest.setProperty("field1", value);

    // then
    assertThat(bean.getField1(), is(value));
  }

  @Test(expectedExceptions = BeanMatchersException.class)
  public void setPropertyShouldThrowExceptionGivenPropertyDoesNotExistOnBean() {
    // given
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
    unitUnderTest = new JavaBean(bean);

    // when
    unitUnderTest.setProperty("propertyThatDoesNotExist", new Object());
  }

  @Test
  public void canGetPropertyFromBean() {
    // given
    Object expectedValue = "test value";
    TestBeanWithOneProperty bean = new TestBeanWithOneProperty();
    bean.setField1(expectedValue);