Test Java by implementing classic algorithms