CalvalusDataInputs { static String determineMostDistinctiveAttribute(String[][] regionAttributeValues) throws InvalidParameterValueException { if (regionAttributeValues.length == 0) { throw new InvalidParameterValueException("no attributes found in shapefile"); } int bestIndex = 0; int bestSize = 0; for (int i=0; i<regionAttributeValues[0].length; ++i) { int size = getSizeOf(regionAttributeValues, i); if (size > bestSize) { bestIndex = i; bestSize = size; } } return regionAttributeValues[0][bestIndex]; } CalvalusDataInputs(ExecuteRequestExtractor executeRequestExtractor,
                       WpsProcess calvalusProcessor,
                       ProductSet[] productSets,
                       CalvalusFacade calvalusFacade); String getValue(String parameterName); @Override String toString(); static final long MIN_DATE; static final long MAX_DATE; static SimpleDateFormat ISO_DATE_FORMAT; }
@Test public void testDistinctiveAttributes() throws InvalidParameterValueException { assertThat("attr2", equalTo(CalvalusDataInputs.determineMostDistinctiveAttribute(FEATURES))); }