### Question:
OMUtils { public static Phenomenon getPhenomenon(final String version, final List<Field> phenomenons) { return getPhenomenon(version, phenomenons, "urn:ogc:phenomenon:", new HashSet<>()); }  static AbstractDataRecord getDataRecordProfile(final String version, final List<Field> phenomenons); static AbstractDataRecord getDataRecordTimeSeries(final String version, final List<Field> phenomenons); static AbstractDataRecord getDataRecordTrajectory(final String version, final List<Field> phenomenons); static Phenomenon getPhenomenon(final String version, final List<Field> phenomenons); static Phenomenon getPhenomenon(final String version, final List<Field> phenomenons, final Set<org.opengis.observation.Phenomenon> existingPhens); static Phenomenon getPhenomenon(final String version, final List<Field> phenomenons, final String phenomenonIdBase, final Set<org.opengis.observation.Phenomenon> existingPhens); static SamplingFeature buildSamplingPoint(final String identifier, final double latitude, final double longitude); static SamplingFeature buildSamplingCurve(final String identifier, final List<DirectPosition> positions); static AbstractObservation buildObservation(final String obsid, final SamplingFeature sf,
            final Phenomenon phenomenon, final String procedure, final int count , final AbstractDataRecord datarecord, final MeasureStringBuilder sb, final TemporalGeometricPrimitive time); static AbstractObservation buildObservation(final String obsid, final SamplingFeature sf,
            final Phenomenon phenomenon, final String procedure, final int count , final AbstractDataRecord datarecord, final List<Object> dataValues, final TemporalGeometricPrimitive time); static final Map<String, TextBlock> TEXT_ENCODING; static final Map<String, AnyScalar> PRESSION_FIELD; static final Map<String, AnyScalar> TIME_FIELD; static final Map<String, AnyScalar> LATITUDE_FIELD; static final Map<String, AnyScalar> LONGITUDE_FIELD; }### Answer:
@Test public void getPhenomenonTest() throws Exception { Field PRES = new Field("PRES", Type.DOUBLE, 1, "pres"); Field PSAL = new Field("PSAL", Type.DOUBLE, 1, "psal"); Field TEMP = new Field("TEMP", Type.DOUBLE, 1, "temp"); List<Field> phenomenons = Arrays.asList(PRES, PSAL, TEMP); final Set<PhenomenonType> components = new LinkedHashSet<>(); for (Field phen : phenomenons) { components.add(new PhenomenonType(phen.label, phen.label)); } String phenomenonIdBase = "urn:ogc:phenomenon:"; final String compositeId = "composite" + UUID.randomUUID().toString(); final String compositeName = phenomenonIdBase + compositeId; CompositePhenomenonType expResult = new CompositePhenomenonType(compositeId, compositeName, null, null, components); Set<org.opengis.observation.Phenomenon> existingPhens = new HashSet<>(); existingPhens.add(expResult); List<Field> newPhens = new ArrayList<>(); newPhens.add(PRES); newPhens.add(PSAL); newPhens.add(TEMP); Phenomenon result = OMUtils.getPhenomenon("1.0.0", newPhens, existingPhens); Assert.assertEquals(expResult.getId(), result.getId()); Assert.assertEquals(expResult, result); newPhens = new ArrayList<>(); newPhens.add(PSAL); newPhens.add(PRES); newPhens.add(TEMP); result = OMUtils.getPhenomenon("1.0.0", newPhens, existingPhens); Assert.assertNotEquals(expResult.getId(), result.getId()); Assert.assertNotEquals(expResult, result); }