### Question:
CovarianceFlux extends AbstractParametrizedFlux { @Nonnull public CovarianceFlux withColumns(@Nonnull final String[] columns) { Arguments.checkNotNull(columns, "Columns are required"); if (columns.length != 2) { throw new IllegalArgumentException("Exactly two columns must be provided."); } this.withPropertyValue("columns", columns); return this; } CovarianceFlux(@Nonnull final Flux source); @Nonnull CovarianceFlux withColumns(@Nonnull final String[] columns); @Nonnull CovarianceFlux withColumns(@Nonnull final Collection<String> columns); @Nonnull CovarianceFlux withPearsonr(final boolean pearsonr); @Nonnull CovarianceFlux withValueDst(@Nonnull final String valueDst);  }### Answer:
@Test void expectedExactlyTwoColumnsArray() { CovarianceFlux flux = Flux.from("telegraf").covariance(); Assertions.assertThatThrownBy(() -> flux.withColumns(new String[]{})) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); Assertions.assertThatThrownBy(() -> flux.withColumns(new String[]{"val1"})) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); Assertions.assertThatThrownBy(() -> flux.withColumns(new String[]{"val1", "val2", "val3"})) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); }
@Test void expectedExactlyTwoColumnsCollection() { CovarianceFlux flux = Flux.from("telegraf").covariance(); Collection<String> columns = new ArrayList<>(); Assertions.assertThatThrownBy(() -> flux.withColumns(columns)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); columns.add("val1"); Assertions.assertThatThrownBy(() -> flux.withColumns(columns)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); columns.add("val2"); columns.add("val3"); Assertions.assertThatThrownBy(() -> flux.withColumns(columns)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Exactly two columns must be provided."); }