A Dukascopy API doesn't provide any specific math methods, but Java does!
Please look at the java.lang.Math class which has all needed rounding functions.
Math must be written starting with capital letter.
Here is a function, that rounds the value till half pip
public static double round05Pips(double value) {
int pipsMultiplier = value <= 20 ? 10000 : 100;
int rounded = (int) (value * pipsMultiplier * 10 + 0.5);
rounded *= 2;
rounded = (int) (((double) rounded) / 10d + 0.5d);
value = ((double) rounded) / 2d;
value /= pipsMultiplier;
return value;
}