code: public static Path serialize(Object source, FileSystem fs, Path targetPath) {
  		Assert.notNull(targetPath, "'targetPath' must not be null");
  		Assert.notNull(fs, "'fs' must not be null");
  		Assert.notNull(source, "'source' must not be null");
  
  		Path resultPath = targetPath.makeQualified(fs.getUri(), fs.getWorkingDirectory());
  		OutputStream targetOutputStream = null;
  		try {
  			targetOutputStream = fs.create(targetPath);
  			SerializationUtils.serialize(source, targetOutputStream);
  		}
  		catch (Exception e) {
  			throw new IllegalStateException("Failed to serialize " + source + " to " + resultPath, e);
  		}
  		return resultPath;
  	}
docs: Will serialize object to HDFS returning its {@link Path}.
  
  @param source
  @param fs
  @param targetPath
  @return