### Question:
Length implements Cloneable, Serializable, Comparable<Length>, JAXBable<JAXBLength> { @SuppressWarnings("unchecked") public static Length parse(String className, String magnitude) throws InvalidUnitsException, ParseException { try { return create((Class<? extends Length>)Class.forName(className), Double.parseDouble(magnitude)); } catch (NumberFormatException | ClassNotFoundException e) { throw new ParseException(className + " " + magnitude, 0); } } protected  Length(double magnitude); static T create(Class<T> type, double magnitude); static T create(Class<T> type, Double magnitude); @SuppressWarnings("unchecked") static T create(Class<T> type, Length from); @SuppressWarnings("unchecked") static Length parse(String className, String magnitude); static double feetToMeters(double feet); static Class<? extends Length> getFixedScaleUnits(Class<? extends Length> type, Length value); static String getLongLabel(Class<? extends Length> type, boolean plural); static String getSelectionLabel(Class<? extends Length> type); static Collection<String> getSelectionLabels(Collection<Class<? extends Length>> types); static String getShortLabel(Class<? extends Length> type, boolean plural); static double metersToFeet(double meters); @Override Length clone(); @Override int compareTo(Length o); @Override boolean equals(Object obj); Class<? extends Length> getDisplayClass(); double getDisplayMagnitude(); Double getDisplayMagnitudeObj(); String getDisplayMagnitudeString(); abstract String getLongLabel(boolean plural); double getMagnitude(); Double getMagnitudeObj(); String getMagnitudeString(); String getSelectionLabel(); abstract String getShortLabel(boolean plural); @Override JAXBLength getWrapper(); @Override int hashCode(); double inFeet(); double inMeters(); boolean isAutoscale(); Length multiplyBy(double factor); Length negate(); String toLongLabelString(); String toLongLabelString(int width, int precision); String toShortLabelString(); String toShortLabelString(int width, int precision); @Override String toString(); static final double METERS_PER_FOOT; static final int MICROMETERS_PER_FOOT; }### Answer:
@Test public void testParse() throws InvalidUnitsException, ParseException { Kilometers length = new Kilometers(5); Assert.assertEquals(length, Length.parse(length.getClass().getName(), length.getMagnitudeString())); }