// return a copy of the combined commonContents and imageContents;
// in theory we want a deep clone of the combined arrays,
// but since it only contains (immutable) Strings, this shallow
// copy is sufficient
Object[][] combinedContents =
new Object[commonContents.length + imageContents.length][2];
int combined = 0;
for (int i = 0; i < commonContents.length; i++, combined++) {
combinedContents[combined][0] = commonContents[i][0];
combinedContents[combined][1] = commonContents[i][1];
}
for (int i = 0; i < imageContents.length; i++, combined++) {
combinedContents[combined][0] = imageContents[i][0];
combinedContents[combined][1] = imageContents[i][1];
}
return combinedContents;