<commit_before>Bean Matchers
=============

[Project documentation](http://docs.bean-matchers.googlecode.com/git/index.html)
[Google Code project page](http://code.google.com/p/bean-matchers/)

Beans are prevalent in our Java world, however these simple structures are commonly
untested. Over the course of a project they can be inflicted with copy and paste errors,
`hashCode`, `equals` and `toString` methods fall out of sync as new properties are added.

Enter Bean Matchers. The Bean Matchers project provides a series of Hamcrest matchers for
testing Java beans. This provides an easy way to gain confidence that your beans are
correct without needing to consume time writing explicit tests for each property. Ensure
a no-args constructor exist. Getters and setters are correctly defined for each property.
Properties are compared in `equals`, influence the generated `hashCode`, and are present
in the output of the `toString` method.

Quick Start
-----------

1. Add the Bean Matchers dependency to your Maven project (Check
[MVN Repository](http://mvnrepository.com/artifact/com.google.code.bean-matchers/bean-matchers)
for the latest version):

    <dependency>
        <groupId>com.google.code.bean-matchers</groupId>
        <artifactId>bean-matchers</artifactId>
        <version>0.8.1</version>
        <scope>test</scope>
    </dependency>

2. Test your bean:

    import static com.google.code.beanmatchers.BeanMatchers.*;
    import static org.hamcrest.CoreMatchers.allOf;
    import static org.hamcrest.MatcherAssert.assertThat;
    
    public class MyBeanTest {
    
        @Test
        public void testBean() {
            assertThat(MyBean.class, allOf(
                    hasValidBeanConstructor(),
                    hasValidGettersAndSetters(),
                    hasValidBeanHashCode(),
                    hasValidBeanEquals(),
                    hasValidBeanToString()
            ));
        }

    }
<commit_msg>Format code blocks in readme file<commit_after>Bean Matchers
=============

* [Project documentation](http://docs.bean-matchers.googlecode.com/git/index.html)
* [Google Code project page](http://code.google.com/p/bean-matchers/)

Beans are prevalent in our Java world, however these simple structures are commonly
untested. Over the course of a project they can be inflicted with copy and paste errors,
`hashCode`, `equals` and `toString` methods fall out of sync as new properties are added.

Enter Bean Matchers. The Bean Matchers project provides a series of Hamcrest matchers for
testing Java beans. This provides an easy way to gain confidence that your beans are
correct without needing to consume time writing explicit tests for each property. Ensure
a no-args constructor exist. Getters and setters are correctly defined for each property.
Properties are compared in `equals`, influence the generated `hashCode`, and are present
in the output of the `toString` method.

Quick Start
-----------

1. Add the Bean Matchers dependency to your Maven project (Check
[MVN Repository](http://mvnrepository.com/artifact/com.google.code.bean-matchers/bean-matchers)
for the latest version):
```xml
<dependency>
    <groupId>com.google.code.bean-matchers</groupId>
    <artifactId>bean-matchers</artifactId>
    <version>0.8.1</version>
    <scope>test</scope>
</dependency>
```

2. Test your bean:
```java
import static com.google.code.beanmatchers.BeanMatchers.*;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.MatcherAssert.assertThat;

public class MyBeanTest {

    @Test
    public void testBean() {
        assertThat(MyBean.class, allOf(
                hasValidBeanConstructor(),
                hasValidGettersAndSetters(),
                hasValidBeanHashCode(),
                hasValidBeanEquals(),
                hasValidBeanToString()
        ));
    }

}
```
{'fraction_non_alphanumeric': 0.09568382735309412, 'fraction_numerical': 0.0026001040041601664, 'mean_word_length': 3.3370913190529876, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2159900', 'n_tokens_mistral': 1047, 'n_tokens_neox': 996, 'n_words': 361}