### Question:
ImbeddedUnitsLengthUtilities { public static Length getLength(String length) { Matcher mat = FloatingPointPattern.matcher(length); if (mat.matches()) { return new Meters(Double.parseDouble(length)); } try { return new LengthUnitsProvider().fromShortLabelString(length); } catch (UnitsParseException e) { mat.reset(); if (mat.find() && mat.end() > 0) { double value = Double.parseDouble(length.substring(mat.start(), mat.end())); return new Meters(value); } } return new Meters(0); } private  ImbeddedUnitsLengthUtilities(); static Length getLength(String length);  }### Answer:
@Test public void testLength() { Length len = ImbeddedUnitsLengthUtilities.getLength("777."); Assert.assertEquals(len, new Meters(777.)); len = ImbeddedUnitsLengthUtilities.getLength("777"); Assert.assertEquals(len, new Meters(777.)); len = ImbeddedUnitsLengthUtilities.getLength("777.333"); Assert.assertEquals(len, new Meters(777.333)); len = ImbeddedUnitsLengthUtilities.getLength("0.333"); Assert.assertEquals(len, new Meters(.333)); len = ImbeddedUnitsLengthUtilities.getLength(".333"); Assert.assertEquals(len, new Meters(.333)); len = ImbeddedUnitsLengthUtilities.getLength("-0.333"); Assert.assertEquals(len, new Meters(-0.333)); len = ImbeddedUnitsLengthUtilities.getLength("-.333"); Assert.assertEquals(len, new Meters(-0.333)); len = ImbeddedUnitsLengthUtilities.getLength("7.773e3"); Assert.assertEquals(len, new Meters(7773.)); len = ImbeddedUnitsLengthUtilities.getLength("+7.773e3"); Assert.assertEquals(len, new Meters(7773.)); len = ImbeddedUnitsLengthUtilities.getLength("777.3e3"); Assert.assertEquals(len, new Meters(777300.)); len = ImbeddedUnitsLengthUtilities.getLength("777.333."); Assert.assertEquals(len, new Meters(777.333)); len = ImbeddedUnitsLengthUtilities.getLength("7000 M"); Assert.assertEquals(len, new Meters(7000.)); len = ImbeddedUnitsLengthUtilities.getLength("77.33 KM"); Assert.assertEquals(len, new Kilometers(77.33)); len = ImbeddedUnitsLengthUtilities.getLength("77.ft"); Assert.assertEquals(len, new Feet(77.)); len = ImbeddedUnitsLengthUtilities.getLength("7.33e5mi"); Assert.assertEquals(len, new StatuteMiles(733000)); }