### Question:
ThresholdFactory { public static ThresholdSha256Condition oneOfTwoCondition( final Condition condition1, final Condition condition2 ) { Objects.requireNonNull(condition1, "condition1 must not be null!"); Objects.requireNonNull(condition2, "condition2 must not be null!"); return constructMOfNCondition( 1, 2, Stream.of(condition1, condition2).collect(Collectors.toList()) ); }  static ThresholdSha256Condition oneOfTwoCondition(
      final Condition condition1, final Condition condition2
  ); static ThresholdSha256Condition twoOfTwoCondition(
      final Condition condition1, final Condition condition2
  ); static ThresholdSha256Condition constructMOfNCondition(
      final int thresholdM, int numSubCondtionsN, final List<Condition> subconditions
  ); static ThresholdSha256Fulfillment oneOfTwoFulfillment(
      final Fulfillment fulfillment, final Condition condition
  ); static ThresholdSha256Fulfillment twoOfTwoFulfillment(
      final Fulfillment fulfillment1, final Fulfillment fulfillment2
  ); static ThresholdSha256Fulfillment constructMOfNFulfillment(
      final int thresholdM, int totalN,
      final List<Condition> subconditions, final List<Fulfillment> subfulfillments
  );  }### Answer:
@Test(expected = NullPointerException.class) public void oneOfTwoConditionWithNullFirst() { try { ThresholdFactory.oneOfTwoCondition(null, subcondition2); } catch (NullPointerException e) { assertThat(e.getMessage(), is("condition1 must not be null!")); throw e; } }
@Test(expected = NullPointerException.class) public void oneOfTwoConditionWithNullSecond() { try { ThresholdFactory.oneOfTwoCondition(subcondition1, null); } catch (NullPointerException e) { assertThat(e.getMessage(), is("condition2 must not be null!")); throw e; } }
@Test public void oneOfTwoCondition() { final ThresholdSha256Fulfillment thresholdFulfillment = ThresholdSha256Fulfillment.from( Lists.newArrayList(subcondition2), Lists.newArrayList(subfulfillment1) ); { final ThresholdSha256Condition thresholdCondition = ThresholdFactory .oneOfTwoCondition(subcondition1, subcondition2); assertThat(thresholdFulfillment.verify(thresholdCondition, "".getBytes()), is(true)); assertThat(thresholdFulfillment.verify(thresholdCondition), is(true)); } { final ThresholdSha256Condition thresholdCondition = ThresholdFactory .oneOfTwoCondition(subcondition1, subcondition1); assertThat(thresholdFulfillment.verify(thresholdCondition, "".getBytes()), is(false)); assertThat(thresholdFulfillment.verify(thresholdCondition), is(false)); } { final ThresholdSha256Condition thresholdCondition = ThresholdFactory .oneOfTwoCondition(subcondition2, subcondition2); assertThat(thresholdFulfillment.verify(thresholdCondition, "".getBytes()), is(false)); assertThat(thresholdFulfillment.verify(thresholdCondition), is(false)); } }