MockJavaMail is a mock library to help unit test using Java Mail api. Idea from https://java.net/projects/mock-javamail