### Question:
JobMetaJsonSerializer extends AbstractMetaJsonSerializer<JobMeta> { @Override protected void serializeHops( JobMeta meta, JsonGenerator json ) throws IOException { json.writeArrayFieldStart( JSON_PROPERTY_HOPS ); int numberOfHops = meta.nrJobHops(); for ( int i = 0; i < numberOfHops; i++ ) { JobHopMeta hopMeta = meta.getJobHop( i ); HopInfo hopInfo = new HopInfo( hopMeta ); json.writeObject( hopInfo ); } json.writeEndArray(); } JobMetaJsonSerializer( Class<JobMeta> aClass );  JobMetaJsonSerializer( JavaType javaType );  JobMetaJsonSerializer( Class<?> aClass, boolean b );   }### Answer:
@Test public void testSerializeHops() throws Exception { JobHopMeta jobHopMeta = mock( JobHopMeta.class ); JobEntryCopy fromJobEntry = mock( JobEntryCopy.class ); JobEntryCopy toJobEntry = mock( JobEntryCopy.class ); when( meta.nrJobHops() ).thenReturn( 2 ); when( meta.getJobHop( anyInt() ) ).thenReturn( jobHopMeta ); when( jobHopMeta.getFromEntry() ).thenReturn( fromJobEntry ); when( jobHopMeta.getToEntry() ).thenReturn( toJobEntry ); when( jobHopMeta.isEnabled() ).thenReturn( true ); when( fromJobEntry.getName() ).thenReturn( "from" ); when( toJobEntry.getName() ).thenReturn( "to" ); serializer.serializeHops( meta, json ); verify( json, times( 2 ) ).writeObject( any( HopInfo.class ) ); }