Hey, first of all you could give us more concrete Information, but ill try my best to help.
Well Greenfoot.getRandomNumber(10) gives you a 0,1,2,3,4,5,6,7,8,9. So you would want to add 1 in order to start from 1 and end at 9 -> when you dont want to start from 0, you have to add the offset (difference of the higher number mius the smaller one). In your case that would be 10 because the highest number 25 is 10 away from your small number 15.
So your code should look like this:
public int getRandomNumber(int startNumber,int endNumber) {
int offsetRandom = Greenfoot.getRandomNumber(endNumber-startNumber+1);
return offsetRandom+startNumber;
}