Here is a Java convenience method to append an element to an array (of any kind):
private static <T> T[] appendToArray(T[] array, T element) {
@SuppressWarnings("unchecked")
T[] newArray = (T[])Array.newInstance(array.getClass().getComponentType(), array.length + 1);
System.arraycopy(array, 0, newArray, 0, array.length);
newArray[array.length] = element;
return newArray;
}