useful factory functions for Java arrays