### Question:
Strings { public static String getDegreesDecimalMinutes(double decimaldegrees, boolean isLatitude) { String cardinality = (decimaldegrees<0) ? "S":"N"; if(!isLatitude){ cardinality = (decimaldegrees<0) ? "W":"E"; } decimaldegrees = Math.abs(decimaldegrees); int deg = (int) Math.floor(decimaldegrees); double minfloat = (decimaldegrees-deg)*60; double min = Math.round(minfloat*10000.0)/10000.0; return ("" + deg + "° " + min + "' " + cardinality); }  static String getDescriptiveDurationString(int numberOfSeconds,
                                                      Context context); static String getBearingDescription(float bearingDegrees,
                                               Context context); static String cleanDescriptionForXml(String desc); static String cleanDescriptionForJson(String desc); static String getIsoDateTime(Date dateToFormat); static String getIsoDateTimeFormat(); static String getIsoCalendarDate(Date dateToFormat); static String getIsoCalendarDateFormat(); static String getReadableDateTime(Date dateToFormat); static boolean isNullOrEmpty(String text); static String htmlDecode(String text); static String getBuildSerial(); static String getFormattedFileName(); static String getFormattedFileName(Session session, PreferenceHelper ph); static String getFormattedCustomFileName(String baseName, Calendar calendar, PreferenceHelper ph); static int toInt(String number, int defaultVal); static String getSpeedDisplay(Context context, double metersPerSecond, boolean imperial); static String getDistanceDisplay(Context context, double meters, boolean imperial, boolean autoscale); static String getTimeDisplay(Context context, long milliseconds); static Map<String, String> getAvailableLocales(Context context); static String getSanitizedMarkdownForFaqView(String md); static String getDegreesMinutesSeconds(double decimaldegrees, boolean isLatitude); static String getDegreesDecimalMinutes(double decimaldegrees, boolean isLatitude); static String getDecimalDegrees(double decimaldegrees); static String getFormattedLatitude(double decimaldegrees); static String getFormattedLongitude(double decimaldegrees); static String getDetectedActivityName(DetectedActivity detectedActivity);  }### Answer:
@Test public void getDegreesDecimalMinutes_BasicConversion(){ double lat = 14.24231d; String expected = "14° 14.5386' N"; String actual = Strings.getDegreesDecimalMinutes(lat, true); assertThat("Degree Decimals converted to Degree Decimal Minutes", actual, is(expected)); }
@Test public void getDegreesDecimalMinutes_NegativeIsSouth(){ double lat = -54.81774d; String expected = "54° 49.0644' S"; String actual = Strings.getDegreesDecimalMinutes(lat, true); assertThat("Negative Degree Decimals converted to southerly Degree Decimal Minutes", actual, is(expected)); }
@Test public void getDegreesDecimalMinutes_Longitude_ReturnsEastWest(){ double lat = 101.898d; String expected = "101° 53.88' E"; String actual = Strings.getDegreesDecimalMinutes(lat, false); assertThat("Longitude values have east west cardinality", actual, is(expected)); lat = -111.111d; expected = "111° 6.66' W"; actual = Strings.getDegreesDecimalMinutes(lat, false); assertThat("Longitude values have east west cardinality", actual, is(expected)); }