@Test public void testModel() { final String expectedDrl = "package org.drools.guvnor.models.commons.backend.packages;\n\n"; final HasPackageName model = new HasPackageName() { private String packageName = "org.drools.guvnor.models.commons.backend.packages"; @Override public String getPackageName() { return packageName; } @Override public void setPackageName(final String packageName) { this.packageName = packageName; } }; final StringBuilder sb = new StringBuilder(); PackageNameWriter.write(sb, model); final String drl = sb.toString(); assertNotNull(drl); assertEquals(expectedDrl, drl); }
public static void write(final StringBuilder sb, final HasPackageName model) { final String packageName = model.getPackageName(); if (!(packageName == null || packageName.isEmpty())) { sb.append("package ").append(packageName).append(";\n\n"); } }
PackageNameWriter { public static void write(final StringBuilder sb, final HasPackageName model) { final String packageName = model.getPackageName(); if (!(packageName == null || packageName.isEmpty())) { sb.append("package ").append(packageName).append(";\n\n"); } } }
PackageNameWriter { public static void write(final StringBuilder sb, final HasPackageName model) { final String packageName = model.getPackageName(); if (!(packageName == null || packageName.isEmpty())) { sb.append("package ").append(packageName).append(";\n\n"); } }  }
PackageNameWriter { public static void write(final StringBuilder sb, final HasPackageName model) { final String packageName = model.getPackageName(); if (!(packageName == null || packageName.isEmpty())) { sb.append("package ").append(packageName).append(";\n\n"); } }  static void write(final StringBuilder sb,
                             final HasPackageName model); }
PackageNameWriter { public static void write(final StringBuilder sb, final HasPackageName model) { final String packageName = model.getPackageName(); if (!(packageName == null || packageName.isEmpty())) { sb.append("package ").append(packageName).append(";\n\n"); } }  static void write(final StringBuilder sb,
                             final HasPackageName model);  }