java basic functional code for DiffTest

reference: warm-up diff21