test_class.declarator: formatter
test_class.modifier: private
test_class.original_string: private TimeFormatter formatter;
test_class.type: TimeFormatter
test_class.var_name: formatter
test_class.declarator: resolver
test_class.modifier: @Mock
test_class.original_string: @Mock StringResolver resolver;
test_class.type: StringResolver
test_class.var_name: resolver
test_class.declarator: captor
test_class.modifier: @Captor
test_class.original_string: @Captor ArgumentCaptor<Long> captor;
test_class.type: ArgumentCaptor<Long>
test_class.var_name: captor
test_class.file: mobile/src/test/java/io/ashdavies/eternity/android/TimeFormatterTest.java
test_class.identifier: TimeFormatterTest
test_case.body: @Test
    public void shouldShowAtLeastOneMinute() throws Exception {
      given(resolver.get(eq(R.string.label_minutes), anyString())).willAnswer(new StringAnswer(StringAnswer.MINUTES));
  
      assertThat(formatter.format(System.currentTimeMillis())).isEqualTo("1m");
    }
test_case.class_method_signature: TimeFormatterTest.shouldShowAtLeastOneMinute()
test_case.full_signature: @Test public void shouldShowAtLeastOneMinute()
test_case.identifier: shouldShowAtLeastOneMinute
test_case.invocations: willAnswer given get eq anyString isEqualTo assertThat format currentTimeMillis
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldShowAtLeastOneMinute()
focal_class.declarator: FORMAT = "MMM dd"
focal_class.modifier: private static final
focal_class.original_string: private static final String FORMAT = "MMM dd";
focal_class.type: String
focal_class.var_name: FORMAT
focal_class.declarator: resolver
focal_class.modifier: private final
focal_class.original_string: private final StringResolver resolver;
focal_class.type: StringResolver
focal_class.var_name: resolver
focal_class.declarator: format
focal_class.modifier: private final
focal_class.original_string: private final SimpleDateFormat format;
focal_class.type: SimpleDateFormat
focal_class.var_name: format
focal_class.file: mobile/src/main/java/io/ashdavies/eternity/android/TimeFormatter.java
focal_class.identifier: TimeFormatter
focal_class.interfaces: implements StringFormatter<Long>
focal_class.class_method_signature: TimeFormatter.TimeFormatter(StringResolver resolver)
focal_class.full_signature: @Inject public  TimeFormatter(StringResolver resolver)
focal_class.identifier: TimeFormatter
focal_class.modifiers: @Inject public
focal_class.parameters: (StringResolver resolver)
focal_class.signature:  TimeFormatter(StringResolver resolver)
focal_class.class_method_signature: TimeFormatter.TimeFormatter(StringResolver resolver, SimpleDateFormat format)
focal_class.full_signature: private  TimeFormatter(StringResolver resolver, SimpleDateFormat format)
focal_class.identifier: TimeFormatter
focal_class.modifiers: private
focal_class.parameters: (StringResolver resolver, SimpleDateFormat format)
focal_class.signature:  TimeFormatter(StringResolver resolver, SimpleDateFormat format)
focal_class.class_method_signature: TimeFormatter.format(Long millis)
focal_class.full_signature: @Override public String format(Long millis)
focal_class.identifier: format
focal_class.modifiers: @Override public
focal_class.parameters: (Long millis)
focal_class.return: String
focal_class.signature: String format(Long millis)
focal_method.body: @Override
    public String format(Long millis) {
      long diff = System.currentTimeMillis() - millis;
  
      if (diff < TimeUnit.HOURS.toMillis(1)) {
        return resolver.get(R.string.label_minutes, Math.max(1, TimeUnit.MILLISECONDS.toMinutes(diff)));
      }
  
      if (diff < TimeUnit.DAYS.toMillis(1)) {
        return resolver.get(R.string.label_hours, Math.max(1, TimeUnit.MILLISECONDS.toHours(diff)));
      }
  
      return format.format(new Date(millis));
    }
focal_method.class_method_signature: TimeFormatter.format(Long millis)
focal_method.full_signature: @Override public String format(Long millis)
focal_method.identifier: format
focal_method.invocations: currentTimeMillis toMillis get max toMinutes toMillis get max toHours format
focal_method.modifiers: @Override public
focal_method.parameters: (Long millis)
focal_method.return: String
focal_method.signature: String format(Long millis)