Added generic java implementation (initial commit)