Frame[] (int delay, Icon @NotNull ... icons) { int length = icons.length; assert length > 0 : "empty array"; Frame[] frames = new Frame[length]; for (int i = 0; i < length; i++) { Icon icon = icons[i]; assert icon != null : "null icon"; frames[i] = new Frame() { @Override public @NotNull Icon getIcon() { return icon; } @Override public int getDelay() { return delay; } }; } return frames; }