IllegalCombination implements CombinationResult { @Override public void applyTo(Collection<Debt> debts) { throw new IllegalStateException("Illegal combination of transactions!"); }  @Override boolean hasChanges(); @Override void applyTo(Collection<Debt> debts); @Override boolean equals(Object obj);  }
@Test public void shouldThrowException() throws Exception { expectedException.expect(IllegalStateException.class); new IllegalCombination().applyTo(null); }