### Question:
TransMetaJsonSerializer extends AbstractMetaJsonSerializer<TransMeta> { @Override protected List<String> getUsedVariables( TransMeta meta ) { return meta.getUsedVariables(); } TransMetaJsonSerializer( Class<TransMeta> aClass );  TransMetaJsonSerializer( JavaType javaType );  TransMetaJsonSerializer( Class<?> aClass, boolean b );   }### Answer:
@Test public void testSerializeVariables() throws Exception { List<String> vars = new ArrayList<String>() {{ add( "var1" ); add( "var2" ); add( "no value" ); }}; when( transMeta.getUsedVariables() ).thenReturn( vars ); when( transMeta.getVariable( "var1" ) ).thenReturn( "value1" ); when( transMeta.getVariable( "var2" ) ).thenReturn( "value2" ); when( transMeta.getVariable( "no value" ) ).thenReturn( null ); serializer.serializeVariables( transMeta, json ); verify( json ).writeArrayFieldStart( TransMetaJsonSerializer.JSON_PROPERTY_VARIABLES ); verify( json, times( vars.size() ) ).writeObject( any( IParamInfo.class ) ); }