When I create a new task and set the start date and the duration with ElapsedDay the finish date is wrong:
Project project = new Project();
Task rootTask = project.getRootTask();
java.util.Calendar start = java.util.Calendar.getInstance();
start.set(java.util.Calendar.DATE, 5);
start.set(java.util.Calendar.HOUR, 9);
start.set(java.util.Calendar.MINUTE, 0);
start.set(java.util.Calendar.SECOND, 0);
start.set(java.util.Calendar.MILLISECOND, 0);
Task a = rootTask.getChildren().add("A");
a.set(Tsk.START, start.getTime());
a.set(Tsk.DURATION, project.getDuration(1d, TimeUnitType.ElapsedDay));
Obtained result: Start: Thu Oct 05 09:00:00 BRT 2017 | Finish: Tue Oct 10 09:00:00 BRT 2017 | Duration: 1 eday
Expected result: Start: Thu Oct 05 09:00:00 BRT 2017 | Finish: Tue Oct 6 09:00:00 BRT 2017 | Duration: 1 eday