### Question:
CombinationUtil { public static boolean canBeAdded(int[] combination, int[] toBeAdded, ConstraintChecker constraintChecker) { Preconditions.notNull(constraintChecker); checkNotNullAndSameLength(combination, toBeAdded); for (int i = 0; i < toBeAdded.length; i++) { if (toBeAdded[i] != NO_VALUE && !(combination[i] == NO_VALUE || combination[i] == toBeAdded[i])) { return false; } } final TIntList dual = new TIntArrayList(); for (int i = 0; i < toBeAdded.length; i++) { if (toBeAdded[i] != NO_VALUE) { dual.add(i); dual.add(toBeAdded[i]); } } return constraintChecker.isExtensionValid(combination, dual.toArray()); } private  CombinationUtil(); static int[] emptyCombination(int size); static boolean contains(int[] firstCombination, int[] secondCombination); static boolean canBeAdded(int[] combination, int[] toBeAdded, ConstraintChecker constraintChecker); static void add(int[] combination, int[] toBeAdded); static boolean containsAllParameters(int[] combination, IntSet parameterIndices); static boolean containsAllParameters(int[] combination, int untilParameter); static boolean sameForAllGivenParameters(int[] first, int[] second, IntSet parameters); static int numberOfSetParameters(int[] combination); static final int NO_VALUE; }### Answer:
@Test void canBeAddedHaveToBeSameLengthAndNotNull() { Assertions.assertThrows(NullPointerException.class, () -> CombinationUtil.canBeAdded(null, new int[0], new NoConstraintChecker())); Assertions.assertThrows(NullPointerException.class, () -> CombinationUtil.canBeAdded(new int[]{0}, null, new NoConstraintChecker())); Assertions.assertThrows(NullPointerException.class, () -> CombinationUtil.canBeAdded(new int[]{0}, new int[]{0}, null)); Assertions.assertThrows(IllegalArgumentException.class, () -> CombinationUtil.canBeAdded(new int[]{0}, new int[]{0, 0}, new NoConstraintChecker())); }