// Path: src/main/java/com/awsmithson/tcx2nikeplus/jaxb/JAXBObject.java
// public enum JAXBObject {
// 	GPX_TYPE {
// 		@Override
// 		@Nonnull Class[] getClassesToBeBound() {
// 			return new Class[] { GpxType.class, TrackPointExtensionT.class };
// 		}
// 	},
// 
// 	TRAINING_CENTER_DATABASE {
// 		@Override
// 		@Nonnull Class[] getClassesToBeBound() {
// 			return new Class[] { TrainingCenterDatabaseT.class };
// 		}
// 	};
// 
// 	abstract @Nonnull Class[] getClassesToBeBound();
// 
// 	private final JAXBContext JAXB_CONTEXT = createJAXBContect();
// 	private @Nonnull JAXBContext createJAXBContect() {
// 		try {
// 			return JAXBContext.newInstance(getClassesToBeBound());
// 		} catch (JAXBException je) {
// 			throw new ExceptionInInitializerError(je);
// 		}
// 	}
// 
// 	private final @Nonnull ThreadLocal<Marshaller> MARSHALLER = new ThreadLocal<Marshaller>() {
// 		protected synchronized Marshaller initialValue() {
// 			try {
// 				Marshaller marshaller = JAXB_CONTEXT.createMarshaller();
// 				marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
// 				return marshaller;
// 			} catch (JAXBException e) {
// 				throw new ExceptionInInitializerError(e);
// 			}
// 		}
// 	};
// 
// 	private final @Nonnull ThreadLocal<Unmarshaller> UNMARSHALLER = new ThreadLocal<Unmarshaller>() {
// 		protected synchronized Unmarshaller initialValue() {
// 			try {
// 				return JAXB_CONTEXT.createUnmarshaller();
// 			} catch (JAXBException e) {
// 				throw new ExceptionInInitializerError(e);
// 			}
// 		}
// 	};
// 
// 	private @Nonnull Marshaller getMarshaller() {
// 		return MARSHALLER.get();
// 	}
// 
// 	private @Nonnull Unmarshaller getUnmarshaller() {
// 		return UNMARSHALLER.get();
// 	}
// 
// 	public void marshal(@Nonnull JAXBElement<?> jaxbElement, @Nonnull StringWriter stringWriter) throws JAXBException {
// 		Preconditions.checkNotNull(jaxbElement, "jaxbElement argument is null.");
// 		Preconditions.checkNotNull(stringWriter, "stringWriter argument is null.");
// 		getMarshaller().marshal(jaxbElement, stringWriter);
// 	}
// 
// 	@Deprecated
// 	public void marshal(@Nonnull JAXBElement<?> jaxbElement, @Nonnull Document document) throws JAXBException {
// 		Preconditions.checkNotNull(jaxbElement, "jaxbElement argument is null.");
// 		Preconditions.checkNotNull(document, "document argument is null.");
// 		getMarshaller().marshal(jaxbElement, document);
// 	}
// 
// 	public @Nonnull <T> T unmarshall(@Nonnull InputStream inputStream) throws JAXBException {
// 		Preconditions.checkNotNull(inputStream, "inputStream argument is null.");
// 
// 		//noinspection unchecked
// 		return (T) getUnmarshaller().unmarshal(new StreamSource(inputStream), getClassesToBeBound()[0]).getValue();
// 	}
// }


import com.awsmithson.tcx2nikeplus.jaxb.JAXBObject;
import com.garmin.xmlschemas.trainingcenterdatabase.v2.TrainingCenterDatabaseT;
import com.topografix.gpx._1._1.GpxType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Calendar;
import java.util.Date;
import javax.annotation.Nonnull;
import javax.xml.bind.JAXBException;
			Assert.assertNotNull("trainingCenterDatabase was null", trainingCenterDatabase);
		}
	}

	@Test
	public void testDownloadGarminGpx() throws IOException, JAXBException, URISyntaxException {
		try (CloseableHttpClient closeableHttpClient = GarminDataType.getGarminHttpSession()) {
			GpxType gpxType = GarminDataType.GPX.downloadAndUnmarshall(closeableHttpClient, 148656142);
			Assert.assertNotNull("gpxType was null", gpxType);
		}
	}

	@Test
	public void testUnmarshallTcx() throws IOException, JAXBException {
		Assert.assertNotNull("Test file missing", getClass().getResource(ACTIVITY_148656142_TCX));
		try (InputStream inputStream = getClass().getResourceAsStream(ACTIVITY_148656142_TCX)) {
			TrainingCenterDatabaseT trainingCenterDatabase = JAXBObject.TRAINING_CENTER_DATABASE.unmarshall(inputStream);
			Assert.assertEquals("activities size incorrect", 1, trainingCenterDatabase.getActivities().getActivity().size());
			Calendar expected = Calendar.getInstance();
			expected.set(2012, Calendar.FEBRUARY, 11, 9, 31, 5);
			expected.set(Calendar.MILLISECOND, 0);
			Date startTime = trainingCenterDatabase.getActivities().getActivity().get(0).getId().toGregorianCalendar().getTime();
			Assert.assertEquals("activity start time incorrect", expected.getTime(), startTime);
		}
	}

	@Test
	public void testUnmarshallGpx() throws IOException, JAXBException {
		Assert.assertNotNull("Test file missing", getClass().getResource(ACTIVITY_148656142_GPX));
		try (InputStream inputStream = getClass().getResourceAsStream(ACTIVITY_148656142_GPX)) {
// Path: src/main/java/com/awsmithson/tcx2nikeplus/jaxb/JAXBObject.java
// public enum JAXBObject {
// 	GPX_TYPE {
// 		@Override
// 		@Nonnull Class[] getClassesToBeBound() {
// 			return new Class[] { GpxType.class, TrackPointExtensionT.class };
// 		}
// 	},
// 
// 	TRAINING_CENTER_DATABASE {
// 		@Override
// 		@Nonnull Class[] getClassesToBeBound() {
// 			return new Class[] { TrainingCenterDatabaseT.class };
// 		}
// 	};
// 
// 	abstract @Nonnull Class[] getClassesToBeBound();
// 
// 	private final JAXBContext JAXB_CONTEXT = createJAXBContect();
// 	private @Nonnull JAXBContext createJAXBContect() {
// 		try {
// 			return JAXBContext.newInstance(getClassesToBeBound());
// 		} catch (JAXBException je) {
// 			throw new ExceptionInInitializerError(je);
// 		}
// 	}
// 
// 	private final @Nonnull ThreadLocal<Marshaller> MARSHALLER = new ThreadLocal<Marshaller>() {
// 		protected synchronized Marshaller initialValue() {
// 			try {
// 				Marshaller marshaller = JAXB_CONTEXT.createMarshaller();
// 				marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
// 				return marshaller;
// 			} catch (JAXBException e) {
// 				throw new ExceptionInInitializerError(e);
// 			}
// 		}
// 	};
// 
// 	private final @Nonnull ThreadLocal<Unmarshaller> UNMARSHALLER = new ThreadLocal<Unmarshaller>() {
// 		protected synchronized Unmarshaller initialValue() {
// 			try {
// 				return JAXB_CONTEXT.createUnmarshaller();
// 			} catch (JAXBException e) {
// 				throw new ExceptionInInitializerError(e);
// 			}
// 		}
// 	};
// 
// 	private @Nonnull Marshaller getMarshaller() {
// 		return MARSHALLER.get();
// 	}
// 
// 	private @Nonnull Unmarshaller getUnmarshaller() {
// 		return UNMARSHALLER.get();
// 	}
// 
// 	public void marshal(@Nonnull JAXBElement<?> jaxbElement, @Nonnull StringWriter stringWriter) throws JAXBException {
// 		Preconditions.checkNotNull(jaxbElement, "jaxbElement argument is null.");
// 		Preconditions.checkNotNull(stringWriter, "stringWriter argument is null.");
// 		getMarshaller().marshal(jaxbElement, stringWriter);
// 	}
// 
// 	@Deprecated
// 	public void marshal(@Nonnull JAXBElement<?> jaxbElement, @Nonnull Document document) throws JAXBException {
// 		Preconditions.checkNotNull(jaxbElement, "jaxbElement argument is null.");
// 		Preconditions.checkNotNull(document, "document argument is null.");
// 		getMarshaller().marshal(jaxbElement, document);
// 	}
// 
// 	public @Nonnull <T> T unmarshall(@Nonnull InputStream inputStream) throws JAXBException {
// 		Preconditions.checkNotNull(inputStream, "inputStream argument is null.");
// 
// 		//noinspection unchecked
// 		return (T) getUnmarshaller().unmarshal(new StreamSource(inputStream), getClassesToBeBound()[0]).getValue();
// 	}
// }


// Path: src/test/java/com/awsmithson/tcx2nikeplus/garmin/GarminDataTypeSlowTest.java
import com.awsmithson.tcx2nikeplus.jaxb.JAXBObject;
import com.garmin.xmlschemas.trainingcenterdatabase.v2.TrainingCenterDatabaseT;
import com.topografix.gpx._1._1.GpxType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Calendar;
import java.util.Date;
import javax.annotation.Nonnull;
import javax.xml.bind.JAXBException;

			Assert.assertNotNull("trainingCenterDatabase was null", trainingCenterDatabase);
		}
	}

	@Test
	public void testDownloadGarminGpx() throws IOException, JAXBException, URISyntaxException {
		try (CloseableHttpClient closeableHttpClient = GarminDataType.getGarminHttpSession()) {
			GpxType gpxType = GarminDataType.GPX.downloadAndUnmarshall(closeableHttpClient, 148656142);
			Assert.assertNotNull("gpxType was null", gpxType);
		}
	}

	@Test
	public void testUnmarshallTcx() throws IOException, JAXBException {
		Assert.assertNotNull("Test file missing", getClass().getResource(ACTIVITY_148656142_TCX));
		try (InputStream inputStream = getClass().getResourceAsStream(ACTIVITY_148656142_TCX)) {
			TrainingCenterDatabaseT trainingCenterDatabase = JAXBObject.TRAINING_CENTER_DATABASE.unmarshall(inputStream);
			Assert.assertEquals("activities size incorrect", 1, trainingCenterDatabase.getActivities().getActivity().size());
			Calendar expected = Calendar.getInstance();
			expected.set(2012, Calendar.FEBRUARY, 11, 9, 31, 5);
			expected.set(Calendar.MILLISECOND, 0);
			Date startTime = trainingCenterDatabase.getActivities().getActivity().get(0).getId().toGregorianCalendar().getTime();
			Assert.assertEquals("activity start time incorrect", expected.getTime(), startTime);
		}
	}

	@Test
	public void testUnmarshallGpx() throws IOException, JAXBException {
		Assert.assertNotNull("Test file missing", getClass().getResource(ACTIVITY_148656142_GPX));
		try (InputStream inputStream = getClass().getResourceAsStream(ACTIVITY_148656142_GPX)) {
			GpxType gpxType = JAXBObject.GPX_TYPE.unmarshall(inputStream);