void (Consumer<? super K> action) { if (k1 != null) { if (k2 != null) { if (k3 != null) { action.accept(k3); } action.accept(k2); } action.accept(k1); } for (int i = 0; i < data.length; i += 2) { Object key = data[i]; if (key != null) { @SuppressWarnings("unchecked") K k = (K)data[i]; action.accept(k); } } }