test_class.declarator: transactionsService = mock(TransactionsService.class)
test_class.modifier: private final
test_class.original_string: private final TransactionsService transactionsService = mock(TransactionsService.class);
test_class.type: TransactionsService
test_class.var_name: transactionsService
test_class.declarator: service = new ReportsService(transactionsService)
test_class.modifier: private final
test_class.original_string: private final ReportsService service = new ReportsService(transactionsService);
test_class.type: ReportsService
test_class.var_name: service
test_class.declarator: transactions = createTransactions()
test_class.modifier: private
test_class.original_string: private Transactions transactions = createTransactions();
test_class.type: Transactions
test_class.var_name: transactions
test_class.file: services/src/test/java/com/greensopinion/finance/services/reports/ReportsServiceTest.java
test_class.identifier: ReportsServiceTest
test_case.body: @Test
  	public void detailsForMonthNoCategories() {
  		PeriodDetails detailsForMonth = service.detailsForMonth(201502);
  		assertEquals("February 2015", detailsForMonth.getName());
  		assertEquals(1, detailsForMonth.getCategories().size());
  		CategorySummary categorySummary = detailsForMonth.getCategories().get(0);
  		assertEquals("Uncategorized", categorySummary.getName());
  		assertEquals(-12345L, categorySummary.getAmount());
  	}
test_case.class_method_signature: ReportsServiceTest.detailsForMonthNoCategories()
test_case.full_signature: @Test public void detailsForMonthNoCategories()
test_case.identifier: detailsForMonthNoCategories
test_case.invocations: detailsForMonth assertEquals getName assertEquals size getCategories get getCategories assertEquals getName assertEquals getAmount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void detailsForMonthNoCategories()
focal_class.declarator: yearMonthFormat = new ThreadLocal<DateFormat>() {
  		@Override
  		protected DateFormat initialValue() {
  			return new SimpleDateFormat("yyyyMM");
  		}
  	}
focal_class.modifier: private static final
focal_class.original_string: private static final ThreadLocal<DateFormat> yearMonthFormat = new ThreadLocal<DateFormat>() {
  		@Override
  		protected DateFormat initialValue() {
  			return new SimpleDateFormat("yyyyMM");
  		}
  	};
focal_class.type: ThreadLocal<DateFormat>
focal_class.var_name: yearMonthFormat
focal_class.declarator: readableYearMonthFormat = new ThreadLocal<DateFormat>() {
  		@Override
  		protected DateFormat initialValue() {
  			return new SimpleDateFormat("MMMMMMMMMMM yyyy");
  		}
  	}
focal_class.modifier: private static final
focal_class.original_string: private static final ThreadLocal<DateFormat> readableYearMonthFormat = new ThreadLocal<DateFormat>() {
  		@Override
  		protected DateFormat initialValue() {
  			return new SimpleDateFormat("MMMMMMMMMMM yyyy");
  		}
  	};
focal_class.type: ThreadLocal<DateFormat>
focal_class.var_name: readableYearMonthFormat
focal_class.declarator: transactionsService
focal_class.modifier: private final
focal_class.original_string: private final TransactionsService transactionsService;
focal_class.type: TransactionsService
focal_class.var_name: transactionsService
focal_class.file: services/src/main/java/com/greensopinion/finance/services/reports/ReportsService.java
focal_class.identifier: ReportsService
focal_class.class_method_signature: ReportsService.ReportsService(TransactionsService transactionsService)
focal_class.full_signature: @Inject  ReportsService(TransactionsService transactionsService)
focal_class.identifier: ReportsService
focal_class.modifiers: @Inject
focal_class.parameters: (TransactionsService transactionsService)
focal_class.signature:  ReportsService(TransactionsService transactionsService)
focal_class.class_method_signature: ReportsService.incomeVersusExpenses()
focal_class.full_signature: public IncomeVersusExpensesReport incomeVersusExpenses()
focal_class.identifier: incomeVersusExpenses
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IncomeVersusExpensesReport
focal_class.signature: IncomeVersusExpensesReport incomeVersusExpenses()
focal_class.class_method_signature: ReportsService.expensesByCategory()
focal_class.full_signature: public ExpensesByCategoryReport expensesByCategory()
focal_class.identifier: expensesByCategory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ExpensesByCategoryReport
focal_class.signature: ExpensesByCategoryReport expensesByCategory()
focal_class.class_method_signature: ReportsService.transactionsForMonth(long yearMonth)
focal_class.full_signature: public PeriodTransactions transactionsForMonth(long yearMonth)
focal_class.identifier: transactionsForMonth
focal_class.modifiers: public
focal_class.parameters: (long yearMonth)
focal_class.return: PeriodTransactions
focal_class.signature: PeriodTransactions transactionsForMonth(long yearMonth)
focal_class.class_method_signature: ReportsService.detailsForMonth(long yearMonth)
focal_class.full_signature: public PeriodDetails detailsForMonth(long yearMonth)
focal_class.identifier: detailsForMonth
focal_class.modifiers: public
focal_class.parameters: (long yearMonth)
focal_class.return: PeriodDetails
focal_class.signature: PeriodDetails detailsForMonth(long yearMonth)
focal_class.class_method_signature: ReportsService.transactions(long yearMonth)
focal_class.full_signature: private List<Transaction> transactions(long yearMonth)
focal_class.identifier: transactions
focal_class.modifiers: private
focal_class.parameters: (long yearMonth)
focal_class.return: List<Transaction>
focal_class.signature: List<Transaction> transactions(long yearMonth)
focal_class.class_method_signature: ReportsService.monthName(final Long yearMonth)
focal_class.full_signature: private String monthName(final Long yearMonth)
focal_class.identifier: monthName
focal_class.modifiers: private
focal_class.parameters: (final Long yearMonth)
focal_class.return: String
focal_class.signature: String monthName(final Long yearMonth)
focal_class.class_method_signature: ReportsService.yearMonth(Date date)
focal_class.full_signature: private Long yearMonth(Date date)
focal_class.identifier: yearMonth
focal_class.modifiers: private
focal_class.parameters: (Date date)
focal_class.return: Long
focal_class.signature: Long yearMonth(Date date)
focal_class.class_method_signature: ReportsService.yearMonthFormat()
focal_class.full_signature: private DateFormat yearMonthFormat()
focal_class.identifier: yearMonthFormat
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: DateFormat
focal_class.signature: DateFormat yearMonthFormat()
focal_class.class_method_signature: ReportsService.readableYearMonthFormat()
focal_class.full_signature: private DateFormat readableYearMonthFormat()
focal_class.identifier: readableYearMonthFormat
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: DateFormat
focal_class.signature: DateFormat readableYearMonthFormat()
focal_method.body: public PeriodDetails detailsForMonth(long yearMonth) {
  		List<Transaction> transactions = new TransactionNormalizer().normalize(transactions(yearMonth));
  		Map<String, Long> amountByCategoryName = new HashMap<>();
  		for (Transaction transaction : transactions) {
  			Category category = transaction.getCategory();
  			String categoryName = category == null ? "Uncategorized" : category.getName();
  			Long amount = amountByCategoryName.get(categoryName);
  			if (amount == null) {
  				amount = 0L;
  			}
  			amountByCategoryName.put(categoryName, amount.longValue() + transaction.getAmount());
  		}
  		List<CategorySummary> categorySummaries = new ArrayList<>();
  		for (Entry<String, Long> entry : amountByCategoryName.entrySet()) {
  			categorySummaries.add(new CategorySummary(entry.getKey(), entry.getValue()));
  		}
  		Collections.sort(categorySummaries, new CategorySummaryAmountDescendingComparator());
  		return new PeriodDetails(monthName(yearMonth), categorySummaries);
  	}
focal_method.class_method_signature: ReportsService.detailsForMonth(long yearMonth)
focal_method.full_signature: public PeriodDetails detailsForMonth(long yearMonth)
focal_method.identifier: detailsForMonth
focal_method.invocations: normalize transactions getCategory getName get put longValue getAmount entrySet add getKey getValue sort monthName
focal_method.modifiers: public
focal_method.parameters: (long yearMonth)
focal_method.return: PeriodDetails
focal_method.signature: PeriodDetails detailsForMonth(long yearMonth)