I came across some Java code that had the following structure:
public MyParameterizedFunction(String param1, int param2) { this(param1, param2, false); }
Try this solution:
public int getScore(int score, Integer... bonus) { if(bonus.length > 0) { return score + bonus[0]; } return score; }