Euclidean algos - java implementations

PR for euclidean implementation, plus corresponding test file.