I have a class A that needs to the tested. The following is the definition of A:
public class A {
public void methodOne(int arg
The best way to deal with such a problem is to use an injected Clock service, used to get new instances of DateTime. That way, your test can inject a mock Clock, which returns a specific DateTime instead of the current time.
Note that the new Java 8 time API defines such a Clock class, specifically for that purpose.