import java.time.format.DateTimeFormatter;
import java.time.YearMonth;
import java.util.HashMap;
import java.util.Map;

class Main {
	public static void main(String[] args) {
		Map<String, Long> expectedValues = new HashMap<>();
		expectedValues.put("2021-06-01", 10L);
		expectedValues.put("2021-07-01", 20L);
		expectedValues.put("2021-08-01", 30L);
		
		transform(expectedValues);
		
		// Show the map, sorted by date
		expectedValues.entrySet().stream()
		    .sorted(Map.Entry.comparingByKey())
		    .forEach(e -> System.out.println(e.getKey() + ": " + e.getValue()));
	}
	
	static void transform(Map<String, Long> expectedValues) {
		YearMonth thisMonth = YearMonth.now();
		DateTimeFormatter format = DateTimeFormatter.ISO_LOCAL_DATE;
		for (int i = 0; i < 12; i++) {
		    String prev = thisMonth.minusMonths(i).atDay(1).format(format);
		    if (!expectedValues.containsKey(prev)) {
		        expectedValues.put(prev, 0L);
		    }
		}
	}
}