title: 100% line coverage with static method
body: <p>I have the following class: </p>
  
  <pre><code>import java.sql.Timestamp;
  
      public class TimeUtil {
  
          public static Timestamp getTimestamp() {
              java.util.Date currentTime = new java.util.Date();
              return new Timestamp(currentTime.getTime());
          }
      }
  </code></pre>
  
  <p>and coded following Junit class: </p>
  
  <pre><code>public class TimeUtilTest {
  
      @Test
      public void getTimestamp() {
          java.util.Date expected = new java.util.Date();
          Timestamp s = TimeUtil.getTimestamp();
  
          assertTrue("not in the expected 
          timeinterval",Math.abs(expected.getTime() - s.getTime()) &lt; 20L);
  
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <hr>
  
  <p>My aim is to achieve 100% line coverage with that test, but currently only 66% lines are covered. Does anybody have an idea how I could maximize the line coverage?</p>