It works according to the conditions but fail the validation. Don't know why, can anyone help?
package com.codegym.task.task26.task2613;
public enum Operation {
INFO,
DEPOSIT,
WITHDRAW,
EXIT;
public static Operation getAllowableOperationByOrdinal(Integer i) {
switch(i) {
case 1: return INFO;
case 2: return DEPOSIT;
case 3: return WITHDRAW;
case 4: return EXIT;
default: throw new IllegalArgumentException();
}
}
}