the out put is always right with different test cases

package com.codegym.task.task02.task0217;
/*
Minimum of four numbers
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int min2;
if (min(a,b)<=c && min(a,b)<=d && min(a,b)<=b){
min2=a;
}else if (min(a,b)>=b && min(a,b)<=d &&min(a,b)<=c){
min2=b;
}else if (min(a,b)>=c && min(a,b)<=d && c<=d){
min2=c;
}else {
min2=d;
}
return min2;
}
public static int min(int a, int b) {
int min1;
if(a<=b){
min1=a;
}else {
min1=b;
}
return min1;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}