@Test
public void testGetCrsFromFgdcMetadata() throws IOException {

    System.out.println("getCrsFromFgdcMetadata");
    //spref is used to determine hte SRS
    System.out.println("testGetBoundingBoxFromFgdcMetadataAE");
    //get the metadata from the test file as a string using this package to locate it ...
    String packageName = this.getClass().getCanonicalName();
    System.out.println("PackageName: " + packageName); //PackageName: gov.usgs.cida.coastalhazards.rest.data.util.MetadataUtilTest
    // this is where the test resource is located - gov.usgs.cida.coastalhazards.rest.data + /ne_AEmeta.xml
    String replaced = packageName.replaceAll("[.]", "/");
    String[] names = replaced.split("/util/MetadataUtilTest");
    String packageNameShort = names[0];
    String testFileFullName = packageNameShort + "/" + CRxml;
    String metadataXml = loadResourceAsString(testFileFullName);
    InputStream in = new ByteArrayInputStream(metadataXml.getBytes("UTF-8"));
    Metadata metadata = null;
    // JAXB will require jaxb-api.jar and jaxb-impl.jar part of java 1.6. Much safer way to interrogate xml and maintain than regex
    try {
        //File file = new File(xmlFile);  // FYI: can also be done via file rather than inputStream
        JAXBContext jaxbContext = JAXBContext.newInstance(Metadata.class);
        Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
        metadata = (Metadata) jaxbUnmarshaller.unmarshal(in);
    } catch (JAXBException e) {
        e.printStackTrace();
    }
    assertNotNull(metadata);
    //Spref spref = metadata.getSpref();
    Horizsys horizsys = metadata.getSpref().getHorizsys();
    assertNotNull(horizsys);
    String expEllips = "GRS 1980";
    String expHorizdn = "North American Datum 1983";
    double expDenflat = 298.257222101;
    double expSemiaxis = 6378137.0;
    // part I
    String ellips = horizsys.getGeodetic().getEllips();
    String horizdn = horizsys.getGeodetic().getHorizdn();
    double denflat = horizsys.getGeodetic().getDenflat();
    double semiaxis = horizsys.getGeodetic().getSemiaxis();
    assertTrue(expEllips.equalsIgnoreCase(ellips));
    assertTrue(expHorizdn.equalsIgnoreCase(horizdn));
    assertEquals(expDenflat, denflat, expDenflat - denflat);
    assertEquals(expSemiaxis, semiaxis, expSemiaxis - semiaxis);
    // part II
    String mapprojn = horizsys.getPlanar().getMapproj().getMapprojn();
    double feast = horizsys.getPlanar().getMapproj().getMapprojp().getFeast();
    double fnorth = horizsys.getPlanar().getMapproj().getMapprojp().getFnorth();
    double latprjo = horizsys.getPlanar().getMapproj().getMapprojp().getLatprjo();
    double longcm = horizsys.getPlanar().getMapproj().getMapprojp().getLongcm();
    double stdparll = horizsys.getPlanar().getMapproj().getMapprojp().getStdparll();
    String expMapprojn = "Albers Conical Equal Area";
    double expFeast = 0.0;
    double expFnorth = 0.0;
    double expLatprjo = 23.0;
    double expLongcm = -96.0;
    double expStdparll = 45.5; // the second of the two children
    assertTrue(expMapprojn.equalsIgnoreCase(mapprojn));
    assertEquals(expFeast, feast, expFeast - feast);
    assertEquals(expFnorth, fnorth, expFnorth - fnorth);
    assertEquals(expLatprjo, latprjo, expLatprjo - latprjo);
    assertEquals(expLongcm, longcm, expLongcm - longcm);
    assertEquals(expStdparll, stdparll, expStdparll - stdparll);
    //CoordinateReferenceSystem expResult = null;
    //CoordinateReferenceSystem result = MetadataUtil.getCrsFromFgdcMetadata(metadata);
    //assertEquals(expResult, result);
}