Update src/main/java/org/gersty/datastructures/lessontwo/Project02.java

refactoring while loop