The following snippet is quite useful when working with unit tests in Java, where you need to mock the Calendar.getInstance() method:

 

final Calendar mockedCalendar = Calendar.getInstance();
mockedCalendar.set(2015, Calendar.JANUARY, 1, 14, 30, 00); //The date is 1/1-2015 @ 14:30:00
 
PowerMockito.mockStatic(Calendar.class);
PowerMockito.when(Calendar.getInstance()).thenAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) throws Throwable {
return mockedCalendar.clone();
}
});