First Java exercise for my Master Thesis