### Question:
LengthUnitsProvider extends AbstractUnitsProvider<Length> { @Override public <T extends Length> T fromUnitsAndMagnitude(Class<T> type, Number magnitude) throws InvalidUnitsException { return Length.create(type, magnitude.doubleValue()); } LengthUnitsProvider(); @Override T convert(Class<T> desiredType, Length source); @Override T fromUnitsAndMagnitude(Class<T> type, Number magnitude); @Override Class<? extends Length> getDisplayClass(Length value); @Override String getLongLabel(Class<? extends Length> type, boolean plural); @Override String getSelectionLabel(Class<? extends Length> type); @Override String getShortLabel(Class<? extends Length> type, boolean plural); @Override Class<Length> getSuperType(); @Override String toShortLabelString(Length obj);  }### Answer:
@Test public void testFromUnitsAndMagnitude() { Assert.assertEquals(new NauticalMiles(1.), new LengthUnitsProvider().fromUnitsAndMagnitude(NauticalMiles.class, Double.valueOf(1.))); }