ConversionInformation { public boolean isValid(CurrencyKey nobtCurrency) { return isSameCurrency(nobtCurrency) == hasDefaultRate(); } ConversionInformation(CurrencyKey foreignCurrencyKey, BigDecimal rate); static ConversionInformation defaultConversionInformation(CurrencyKey currencyKey); boolean isValid(CurrencyKey nobtCurrency); CurrencyKey getForeignCurrencyKey(); BigDecimal getRate();  }
@Test public void givenAConversionInformationWithOtherRateThanDefault_whenCheckedForValidity_thenShouldReportTrue() throws Exception { final ConversionInformation conversionInformation = new ConversionInformation(USD, BigDecimal.valueOf(1.2)); assertThat(conversionInformation, isValid(EUR, is(true))); }