Skip to content
Small library for filling beans with random data.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Small library for recursively filling java beans with random data.


BeanFiller beanfiller = new BeanFiller();
Bean bean = beanfiller.fillBean(Bean.class);

Currently supported Object Types

Boolean (and boolean)
Byte (and byte)
Character (and char)
Double (and double)
Float (and float)
Integer (and int)
List (using ArrayList)
Long (and long)
Map (using HashMap)
Short (and short)

Bean members of your Bean are scanned recursively for the above classes and are also being filled.

Simple workflow of BeanFiller

BeanFiller -> Strategy -> Creator -> Criteria

The BeanFiller gets the approriate Strategy for the given class to fill, which then calls the corresponding Creator for this class to create it. The Creator relies on a Criteria to provide some edge conditions like min and max values for numbers. This happens recursively, so other Beans within your Beans also get filled.

You can haevily customise the BeanFiller by:

  • adding your own Strategies
  • adding your own Creators or replacing the standard Creators
  • adding your own Criterias or replacing / reconfiguring the standard Criterias

TODO more documentation in the readme

For more information, see javadoc and tests.

next up

  • Documentation in the
  • JSR303 Bean Validation Extension
You can’t perform that action at this time.