Pregunta de entrevista de Tavant

1st round questions were asked in core Java,spring,collections,multi threading, serialization and was told to write few programs. 2nd round questions were in Java 8 features, design patterns, wrapper class, write a program to check if the entered 10 numbers are in sequence from 0 to 9. Optimize that code