Implementing Bankers Algorithm in java