My java sample for general purpose