Replaces strings in streams in Java