/** true if the object *is* a {@link CharSequence} starting with the given prefix */ public static Predicate<Object> isStringStartingWith(final String prefix) { return Predicates.<Object>and(Predicates.instanceOf(CharSequence.class), Predicates.compose(startsWith(prefix), StringFunctions.toStringFunction())); }
public static String getMinimalLauncherPropertiesString() throws IOException { BrooklynProperties p1 = LocalManagementContextForTests.builder(true).buildProperties(); Properties p = new Properties(); p.putAll(Maps.transformValues(p1.asMapWithStringKeys(), StringFunctions.toStringFunction())); Writer w = new StringWriter(); p.store(w, "test"); w.close(); return w.toString()+"\n"; }