K-Means algorithm java implementation