title: How to override current system time to a specific date in a Java 8 web application with EasyMock, without Joda Time, and without PowerMock?
body: <p>I need to mock time (to a <strong>specific</strong> date, meaning I may not use <code>anyLong()</code>) for testing purposes in Java 8 using solely <code>java.time</code>, thus without Joda Time, in a testing environment under EasyMock.</p>
  
  <p>EasyMock doesn't let you mock static methods like <code>LocalDateTime.now()</code>. PowerMock does, but I am not allowed to use PowerMock.</p>
  
  <p>Joda Time library provides a neat and elegant way to mock time with <code>DateTimeUtils.setCurrentMillisFixed()</code>, and <code>DateTimeUtils.setCurrentMillisSystem()</code> to get back to the present instant. </p>
  
  <p>Only I am not allowed to use Joda Time.</p>
  
  <p>I was told to use a mock clock <code>java.time.Clock</code> class instance and inject it into <code>LocalDateTime.now()</code> like this: <code>LocalDateTime.now(mockClock)</code></p>
  
  <p>Is there a way to implement it properly <strong>without Joda Time</strong> and 
  <strong>without PowerMock</strong>?</p>