Misc java programming samples