research mockito
http://www.codeproject.com/Articles/516360/Mockito-a-great-mock-framework-for-Java-developmen