Class AlwaysIncreasingSystem2


  • public class AlwaysIncreasingSystem2
    extends System2
    A subclass of System2 which implementation of System2.now() always return a bigger value than the previous returned value.

    This class is intended to be used in Unit tests.

    • Constructor Detail

      • AlwaysIncreasingSystem2

        public AlwaysIncreasingSystem2​(long increment)
      • AlwaysIncreasingSystem2

        public AlwaysIncreasingSystem2​(long initialValue,
                                       int increment)
      • AlwaysIncreasingSystem2

        public AlwaysIncreasingSystem2()
        Values returned by now() will start with a random value and increment by 100.
    • Method Detail

      • now

        public long now()
        Description copied from class: System2
        Shortcut for System.currentTimeMillis() Since 6.4 you can also inject Clock instead of System2
        Overrides:
        now in class System2