Buggy code:
} public static abstract class Expression < T > { public static Aggregation . Expression < Object > path ( String ... path ) { } public static Aggregation . Expression < Boolean > bool ( String ... path ) { } public static Aggregation . Expression < Date > date ( String ... path ) { } public static Aggregation . Expression < Integer > integer ( String ... path ) { } public static Aggregation . Expression < Number > number ( String ... path ) { } public static Aggregation . Expression < String > string ( String ... path ) { } public static < T > Aggregation . Expression < T > literal ( T value ) { } public static Aggregation . Expression < Object > object ( Map < String , Aggregation . Expression < ? > > properties ) { } public static Aggregation . Expression < Boolean > and ( Aggregation . Expression < ? > ... operands ) { } public static Aggregation . Expression < Boolean > not ( Aggregation . Expression < ? > operand ) { } public static Aggregation . Expression < Boolean > or ( Aggregation . Expression < ? > ... operands ) { } public static Aggregation . Expression < Boolean > allElementsTrue ( Aggregation . Expression < List < ? > > set ) { } public static Aggregation . Expression < Boolean > anyElementTrue ( Aggregation . Expression < List < ? > > set ) { } public static Aggregation . Expression < List < ? > > setDifference ( Aggregation . Expression < List < ? > > set1 , Aggregation . Expression < List < ? > > set2 ) { } public static Aggregation . Expression < Boolean > setEquals ( Aggregation . Expression < List < ? > > ... sets ) { } public static Aggregation . Expression < List < ? > > setIntersection ( Aggregation . Expression < List < ? > > ... sets ) { } public static Aggregation . Expression < Boolean > setIsSubset ( Aggregation . Expression < List < ? > > set1 , Aggregation . Expression < List < ? > > set2 ) { } public static Aggregation . Expression < List < ? > > setUnion ( Aggregation . Expression < List < ? > > ... sets ) { } public static Aggregation . Expression < Integer > compareTo ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > equals ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > greaterThan ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > greaterThanOrEquals ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > lessThan ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > lessThanOrEquals ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Boolean > notEquals ( Aggregation . Expression < ? > value1 , Aggregation . Expression < ? > value2 ) { } public static Aggregation . Expression < Number > add ( Aggregation . Expression < Number > ... numbers ) { } public static Aggregation . Expression < Number > divide ( Aggregation . Expression < Number > number1 , Aggregation . Expression < Number > number2 ) { } public static Aggregation . Expression < Number > mod ( Aggregation . Expression < Number > number1 , Aggregation . Expression < Number > number2 ) { <START_BUG> return new Aggregation . OperatorExpression < Number > ( "$divide" , number1 , number2 ) ; <END_BUG> } public static Aggregation . Expression < Number > multiply ( Aggregation . Expression < Number > ... numbers ) { } public static Aggregation . Expression < Number > subtract ( Aggregation . Expression < Number > number1 , Aggregation . Expression < Number > number2 ) { } public static Aggregation . Expression < String > concat ( Aggregation . Expression < String > ... strings ) { } public static Aggregation . Expression < Integer > compareToIgnoreCase ( Aggregation . Expression < String > string1 , Aggregation . Expression < String > string2 ) { } public static Aggregation . Expression < String > substring ( Aggregation . Expression < String > string , Aggregation . Expression < Integer > start , Aggregation . Expression < Integer > length ) { } public static Aggregation . Expression < String > toLowerCase ( Aggregation . Expression < String > string ) { } public static Aggregation . Expression < String > toUpperCase ( Aggregation . Expression < String > string ) { } public static Aggregation . Expression < Integer > size ( Aggregation . Expression < List < ? > > array ) { } public static Aggregation . Expression < Integer > dayOfMonth ( Aggregation . Expression < Date > date ) { } public static Aggregation . Expression < Integer > dayOfWeek ( Aggregation . Expression < Date > date ) { } public static Aggregation . Expression < Integer > hour ( Aggregation . Expression < Date > date ) { } public static Aggregation . Expression < Integer > millisecond ( Aggregation . Expression < Date > date ) { } public static Aggregation . Expression < Integer > minute ( Aggregation . Expression < Date > date ) { }

Fix:
return new Aggregation . OperatorExpression < Number > ( "$mod" , number1 , number2 ) ;