Can somebody tell my why this code doesn't pass? I know the values aren't right but I followed the algorithm and I don't understand where is the mistake.

package en.codegym.task.pro.task09.task0905;
/*
Octal converter
*/
public class Solution {
public static void main(String[] args) {
int decimalNumber = 21;
// System.out.println((decimalNumber % 8) * 10);
System.out.println("Decimal number " + decimalNumber + " is equal to octal number " + toOctal(decimalNumber));
int octalNumber = 25;
// System.out.println((octalNumber % 10) * 8);
System.out.println("Octal number " + octalNumber + " is equal to decimal number " + toDecimal(octalNumber));
}
public static int toOctal(int decimalNumber) {
int i = 0;
int octalNumber = 0;
int divisionRemainder = (decimalNumber % 8) * 10;
if (decimalNumber > 0) {
while (decimalNumber != 0) {
octalNumber = (int) (octalNumber + Math.pow(divisionRemainder, i));
decimalNumber = decimalNumber / 8;
i++;
}
return (int) octalNumber;
}
return 0;
}
public static int toDecimal(int octalNumber) {
int i = 0;
int decimalNumber = 0;
int divisionRemainder = (octalNumber % 10) * 8;
if (octalNumber > 0) {
while (octalNumber != 0) {
decimalNumber = (int) (decimalNumber + Math.pow(divisionRemainder, i));
octalNumber = octalNumber / 10;
i++;
}
return (int) decimalNumber;
}
return 0;
}
}