int (String goal) { if (standardGoalOrder == null) { standardGoalOrder = new HashMap<>(); int i = 0; for (String aGoal : MavenConstants.PHASES) { standardGoalOrder.put(aGoal, i++); } } Integer order = standardGoalOrder.get(goal); return order != null ? order.intValue() : standardGoalOrder.size(); }