@Test public void shouldReturnCorrectPriceLevelCount() { assertThat(new PriceLevels(new Price(1.0), new Price(2.0), new Price(3.0)).count()).isEqualTo(3); assertThat(new PriceLevels(new Price(2.0)).count()).isEqualTo(1); assertThat(new PriceLevels().count()).isEqualTo(0); }
public int count() { return priceLevels.length; }
PriceLevels { public int count() { return priceLevels.length; } }
PriceLevels { public int count() { return priceLevels.length; } PriceLevels(final Price... priceLevels);  PriceLevels(final List<Price> priceLevels); }
PriceLevels { public int count() { return priceLevels.length; } PriceLevels(final Price... priceLevels);  PriceLevels(final List<Price> priceLevels); Optional<Price> nextHigherLevel(final Price price); Optional<Price> nextLowerLevel(final Price price); int count(); Price get(final int index); boolean contains(final Price price); @Override String toString(); }
PriceLevels { public int count() { return priceLevels.length; } PriceLevels(final Price... priceLevels);  PriceLevels(final List<Price> priceLevels); Optional<Price> nextHigherLevel(final Price price); Optional<Price> nextLowerLevel(final Price price); int count(); Price get(final int index); boolean contains(final Price price); @Override String toString();  }