My java code and demo