add snippet for public java method