package beaform.utilities;

import java.util.Date;

public class SystemTime {

	private static final TimeSource defaultSrc = () ->  System.currentTimeMillis();

	private static volatile TimeSource source;

	public static void reset() {
		source = null;
	}

	public static long getAsLong() {
		return getCurrentTimeSource().getSystemTime();
	}

	public static Date getAsDate() {
		return new Date(getAsLong());
	}

	private static TimeSource getCurrentTimeSource() {
		if (source != null) {
			return source;
		}
		return defaultSrc;
	}

	public static void setTimeSource(TimeSource timeSource) {
		source = timeSource;
	}

	private SystemTime() {
		// Utility classes don't need public constructors.
	}
}

@@ -52,16 +52,22 @@
 %0Apublic 
+final 
 class Sy
@@ -205,16 +205,97 @@
 ource;%0A%0A
+%09private SystemTime() %7B%0A%09%09// Utility classes don't need public constructors.%0A%09%7D%0A%0A
 %09public 
@@ -705,88 +705,7 @@
 ;%0A%09%7D
-%0A%0A%09private SystemTime() %7B%0A%09%09// Utility classes don't need public constructors.%0A%09%7D
 %0A%7D%0A

Make this class final