public static String prettyTime(String timeInMillisec) {
    if (timeInMillisec == null) {
      return "";
    }
    return prettyTime(Long.parseLong(timeInMillisec),
        OmniNotes.getAppContext().getResources().getConfiguration().locale);
  }
@Test
  public void prettyTime() {
    long now = Calendar.getInstance().getTimeInMillis();

    String prettyTime = DateUtils.prettyTime(now, Locale.ENGLISH);
    Assert.assertEquals("moments ago", prettyTime.toLowerCase());

    prettyTime = DateUtils.prettyTime(now + 10 * 60 * 1000, Locale.ENGLISH);
    Assert.assertEquals("10 minutes from now", prettyTime.toLowerCase());

    prettyTime = DateUtils.prettyTime(now + 24 * 60 * 60 * 1000, Locale.ITALIAN);
    Assert.assertEquals("fra 24 ore", prettyTime.toLowerCase());

    prettyTime = DateUtils.prettyTime(now + 25 * 60 * 60 * 1000, Locale.ITALIAN);
    Assert.assertEquals("fra 1 giorno", prettyTime.toLowerCase());

    prettyTime = DateUtils.prettyTime(null, Locale.JAPANESE);
    Assert.assertNotNull(prettyTime.toLowerCase());
    Assert.assertEquals(0, prettyTime.toLowerCase().length());
  }