updated examples
added JUnit test