Implementation of K means algorithm in Java.