TableLine { public ImmutableMap<String, String> getLineMapWithStringsQuoted() { return ImmutableMapFactory.createWithNewValues( getLineMap(), this::quoteStringIfNecessary); } TableLine(ImmutableMap<String, String> lineMap, ImmutableSet<String> stringColumns); ImmutableMap<String, String> getLineMap(); ImmutableMap<String, String> getLineMapWithStringsQuoted();  }
@Test void testGetLineMapWithStringsQuotedQuotesUnquotedStrings() { ImmutableSet<String> stringColumnsToQuote = ImmutableSet.of("Header1"); ImmutableMap<String, String> expectedLineMap = ImmutableMap.of( "Header1", "\"Test\"", "Header2", "SecondTest" ); TableLine tableLine = new TableLine( ImmutableMap.of("Header1", "Test", "Header2", "SecondTest"), stringColumnsToQuote); Assertions.assertEquals(expectedLineMap, tableLine.getLineMapWithStringsQuoted()); }